Search Linux Wireless

[PATCH 1/3] iw: check nlmsg_allocation

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

 



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 dddd36e..412d77b 100644
--- a/cqm.c
+++ b/cqm.c
@@ -34,6 +34,8 @@ static int iw_cqm_rssi(struct nl80211_state *state,

        /* 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