summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorHema Prathaban <hemaklnce@gmail.com>2013-05-14 20:59:19 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-15 14:23:40 -0400
commitae053253a7971b6c97ad570e0f373974ca6d7e06 (patch)
treee18b50f96abf98ea8a4dc5d6a74357950d4a3319 /drivers/staging/rtl8192e
parent95d8ee5403b195aea7c18520ef635ff14717ed1e (diff)
downloadblackbird-op-linux-ae053253a7971b6c97ad570e0f373974ca6d7e06.tar.gz
blackbird-op-linux-ae053253a7971b6c97ad570e0f373974ca6d7e06.zip
staging: rtl8192e: Fix potential null dereference
check memory is allocated in '*challenge' before using it. Signed-off-by: Hema Prathaban <hemaklnce@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 4feecec8609c..8af0b9902615 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -1802,7 +1802,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); /*TODO - check here*/
+ if (!*challenge)
+ return -ENOMEM;
+ memcpy(*challenge, t, *chlen);
}
}
return cpu_to_le16(a->status);
OpenPOWER on IntegriCloud