提交 9603ff50 编写于 作者: X Xiaochen Wang 提交者: 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: NXiaochen Wang <wangxiaochen0@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册