Skip to content

Commit

Permalink
staging: rtl8192e use kmemdup and check its return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiaochen Wang authored and Greg Kroah-Hartman committed Mar 7, 2011
1 parent 0875abf commit 9603ff5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 9603ff5

Please sign in to comment.