diff options
author | Gujulan Elango, Hari Prasath (H.) <hgujulan@visteon.com> | 2015-05-13 14:35:25 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-31 10:01:51 +0900 |
commit | 4bff39dfb75743c44d429b84b3810a955b8192b2 (patch) | |
tree | e69bba51c74c8da52a336608fb0257c054ad29aa /drivers/staging/wlan-ng | |
parent | 7f804436fbd32c9784a2ae5324e64f9d4717c898 (diff) |
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>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/p80211conv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index bd69e8cf200f..c0e6ac8a28eb 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -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), |