Commit dde27e03 authored by wzt.wzt@gmail.com's avatar wzt.wzt@gmail.com Committed by Greg Kroah-Hartman
Browse files

Staging: rtl8192u: Check kmalloc return value before use the buffer in ieee80211_softmac.c



Check kmalloc return value before use the buffer.

Signed-off-by: default avatarZhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 318a5b2a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
		}
	}