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.kha...@samsung.com>
Signed-off-by: Rahul Jain <rahul.j...@samsung.com>
---
 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

Reply via email to