1
0
Fork 0

staging: wlan-ng: check return value of kmalloc

check return value of kmalloc before accessing the memory pointer and
return -ENOMEM if allocation fails.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Gujulan Elango, Hari Prasath (H.) 2015-05-13 14:35:25 +00:00 committed by Greg Kroah-Hartman
parent 7f804436fb
commit 4bff39dfb7
1 changed files with 2 additions and 0 deletions

View File

@ -207,6 +207,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* XXXX need to pick keynum other than default? */
p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
if (!p80211_wep->data)
return -ENOMEM;
foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
skb->len,
(wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK),