diff options
author | wzt.wzt@gmail.com <wzt.wzt@gmail.com> | 2010-05-05 06:56:52 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 18:36:11 (GMT) |
commit | dde27e03cc964526531fdf2bd58c1e4ee4525074 (patch) | |
tree | e6aae901655605fffeb41595d2713ea86cfa4db3 /drivers/staging/rtl8192u/ieee80211 | |
parent | 318a5b2a505fe7a99f0d89889e7a84d57ec49b15 (diff) | |
download | linux-fsl-qoriq-dde27e03cc964526531fdf2bd58c1e4ee4525074.tar.xz |
Staging: rtl8192u: Check kmalloc return value before use the buffer in ieee80211_softmac.c
Check kmalloc return value before use the buffer.
Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 148424a..e5e583e 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1580,6 +1580,8 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen) if(*(t++) == MFIE_TYPE_CHALLENGE){ *chlen = *(t++); *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC); + if (!*challenge) + return -ENOMEM; memcpy(*challenge, t, *chlen); } } |