mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Checks for Null return of skb_alloc in function fw_download_code
@ 2014-06-18 17:53 Nicholas Krause
  2014-06-18 18:14 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Krause @ 2014-06-18 17:53 UTC (permalink / raw)
  To: gregkh; +Cc: lisa, valentina.manea.m, ben, devel, linux-kernel

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 11e915e..fde17ff 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -62,12 +62,15 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 
 		skb  = dev_alloc_skb(frag_length + 4);
+		if (!skb) {
+				rt_status = false;
+				return rt_status;
+
+		}
 		memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
 		tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
 		tcb_desc->queue_index = TXCMD_QUEUE;
 		tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
 		tcb_desc->bLastIniPkt = bLastIniPkt;
-		}
 
 		seg_ptr = skb->data;
 		for (i = 0; i < frag_length; i += 4) {
-- 
1.9.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-18 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 17:53 [PATCH] Checks for Null return of skb_alloc in function fw_download_code Nicholas Krause
2014-06-18 18:14 ` Greg KH
2014-06-18 20:59   ` Nick Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®