Commit 0875abf8 authored by Xiaochen Wang's avatar Xiaochen Wang Committed by Greg Kroah-Hartman

staging: rtl8187se: check kmalloc return value

check kmalloc return value
Signed-off-by: default avatarXiaochen Wang <wangxiaochen0@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9025c0fa
...@@ -1435,8 +1435,9 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen) ...@@ -1435,8 +1435,9 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen)
if(*(t++) == MFIE_TYPE_CHALLENGE){ if(*(t++) == MFIE_TYPE_CHALLENGE){
*chlen = *(t++); *chlen = *(t++);
*challenge = kmalloc(*chlen, GFP_ATOMIC); *challenge = kmemdup(t, *chlen, GFP_ATOMIC);
memcpy(*challenge, t, *chlen); if (!*challenge)
return -ENOMEM;
} }
} }
......
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