mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
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
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Reference in a new issue