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:
parent
318a5b2a50
commit
dde27e03cc
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user