Skip to content

Commit

Permalink
iw: cqm: check nlmsg_alloc() return
Browse files Browse the repository at this point in the history
If nlmsg_alloc() fails, don't crash but return an error.

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Amit Khatri authored and jmberg-intel committed Aug 13, 2015
1 parent 63e11c4 commit 8b80a2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cqm.c
Expand Up @@ -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);
Expand Down

0 comments on commit 8b80a2b

Please sign in to comment.