summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192u
diff options
context:
space:
mode:
authorIker Pedrosa <ikerpedrosam@gmail.com>2013-09-20 17:11:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-25 16:53:39 -0700
commitc3aed2312fd3c74e77e049b795e092689d414474 (patch)
treed4386049d6dee15d75af90770bbd4830a936831a /drivers/staging/rtl8192u
parent3ff4afe80e50ff4e84b4a59a38a6a657d1e7fdd1 (diff)
Staging: rtl8192u: r819xU_cmdpkt: checking NULL value after doing dev_alloc_skb
Checking the return of dev_alloc_skb as stated in the following bug: https://bugzilla.kernel.org/show_bug.cgi?id=60411 Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> Reported-by: RUC_Soft_Sec rucsoftsec@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r--drivers/staging/rtl8192u/r819xU_cmdpkt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 5bc361b16d4..56144014b7c 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -37,6 +37,8 @@ rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
/* Get TCB and local buffer from common pool.
(It is shared by CmdQ, MgntQ, and USB coalesce DataQ) */
skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
+ if (!skb)
+ return RT_STATUS_FAILURE;
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;