dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
wzt.wzt@gmail.com 2010-05-05 14:56:52 +08:00 committed by Greg Kroah-Hartman
parent 318a5b2a50
commit dde27e03cc
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}
}