Search Linux Wireless

[PATCH 4/4] iw:In case of memory allocation failure by nlmsg_alloc() cqm will pass to NLA_PUT_U32. it should not happen.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johannes,

Subject: [PATCH 4/4] iw:In case of memory allocation failure by nlmsg_alloc()
 cqm will pass to NLA_PUT_U32. it should not happen.

Signed-off-by: Amit Khatri <amit.khatri@xxxxxxxxxxx>
Signed-off-by: Rahul Jain <rahul.jain@xxxxxxxxxxx>
---
 cqm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cqm.c b/cqm.c
index 65876af..bf60401 100644
--- a/cqm.c
+++ b/cqm.c
@@ -34,6 +34,8 @@ static int iw_cqm_rssi(struct nl80211_state *state, struct nl_cb *cb,
 
 	/* connection quality monitor attributes */
 	cqm = nlmsg_alloc();
+	if(!cqm)
+		return -ENOMEM;
 
 	NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_THOLD, thold);
 	NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_HYST, hyst);
-- 
1.9.1
��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux