mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
staging: rtl8187se: check kmalloc return value
check kmalloc return value Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
9025c0faee
commit
0875abf83d
1 changed files with 3 additions and 2 deletions
|
@ -1435,8 +1435,9 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen)
|
|||
|
||||
if(*(t++) == MFIE_TYPE_CHALLENGE){
|
||||
*chlen = *(t++);
|
||||
*challenge = kmalloc(*chlen, GFP_ATOMIC);
|
||||
memcpy(*challenge, t, *chlen);
|
||||
*challenge = kmemdup(t, *chlen, GFP_ATOMIC);
|
||||
if (!*challenge)
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue