Commit 9603ff50 authored by Xiaochen Wang's avatar Xiaochen Wang Committed by Greg Kroah-Hartman

staging: rtl8192e use kmemdup and check its return value

use kmemdup instead of kmalloc and memcpy,
and check its return value
Signed-off-by: default avatarXiaochen Wang <wangxiaochen0@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0875abf8
...@@ -1564,8 +1564,9 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen) ...@@ -1564,8 +1564,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