Commit dde27e03 authored by wzt.wzt@gmail.com's avatar wzt.wzt@gmail.com Committed by Greg Kroah-Hartman

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: default avatarZhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 318a5b2a
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment