]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - cqm.c
iw: cqm: check nlmsg_alloc() return
[thirdparty/iw.git] / cqm.c
diff --git a/cqm.c b/cqm.c
index dddd36e8689c2eaf55a18cbc41a816c15aeea58e..093b744baba501c3bba645720eca1a826462d4b9 100644 (file)
--- 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);