提交 0875abf8 编写于 作者: X Xiaochen Wang 提交者: Greg Kroah-Hartman

staging: rtl8187se: check kmalloc return value

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