Skip to content

Commit

Permalink
Staging: rtl8192u: Check kmalloc return value before use the buffer i…
Browse files Browse the repository at this point in the history
…n ieee80211_softmac.c

Check kmalloc return value before use the buffer.

Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
wzt.wzt@gmail.com authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 318a5b2 commit dde27e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,8 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen)
if(*(t++) == MFIE_TYPE_CHALLENGE){
*chlen = *(t++);
*challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
if (!*challenge)
return -ENOMEM;
memcpy(*challenge, t, *chlen);
}
}
Expand Down

0 comments on commit dde27e0

Please sign in to comment.