[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110506002210.778991868@clark.kroah.org>
Date: Thu, 05 May 2011 17:20:42 -0700
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>
Subject: [057/143] Staging: rtl8192su: check for skb == NULL
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Florian Schilhabel <florian.c.schilhabel@...glemail.com>
commit 199ef62a287b429a8fa3b7dc5ae6b69f607bf324 upstream.
added 2 checks for skb == NULL.
plus cosmetics
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@...glemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
[bwh: Remove cosmetic changes]
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/staging/rtl8192su/r8192S_firmware.c | 5 +++++
drivers/staging/rtl8192su/r819xU_cmdpkt.c | 6 ++++++
2 files changed, 11 insertions(+)
--- a/drivers/staging/rtl8192su/r8192S_firmware.c
+++ b/drivers/staging/rtl8192su/r8192S_firmware.c
@@ -68,6 +68,11 @@ bool FirmwareDownloadCode(struct net_dev
/* Allocate skb buffer to contain firmware info and tx descriptor info. */
skb = dev_alloc_skb(frag_length);
+ if (skb == NULL) {
+ RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n",
+ __func__);
+ goto cmdsend_downloadcode_fail;
+ }
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
--- a/drivers/staging/rtl8192su/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192su/r819xU_cmdpkt.c
@@ -56,6 +56,12 @@ SendTxCommandPacket(
//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 == NULL) {
+ RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n",
+ __func__);
+ rtStatus = false;
+ return rtStatus;
+ }
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists