mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 02:31:27 +02:00
staging: rtl8192e use kmemdup and check its return value
use kmemdup instead of kmalloc and memcpy, and check its 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
0875abf83d
commit
9603ff50b5
|
|
@ -1564,8 +1564,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 New Issue
Block a user