Skip to contentSkip to conversation

Fixes function fw_download_code to check for Null return from dev_skb_alloc

PATCH In review Nicholas Krause 2 participants 2 messages Jun 17, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fixes function fw_download_code to check for Null return from dev_skb_alloc

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +3 -1
index 11e915e..e4c8224 100644
@@ -62,12 +62,14 @@ 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) {
Signature · 1 line
1.9.1
maintainer
#1 lore raw

Lots of things wrong here, please step back, and slow down.

Your subject, this really isn't "v2", is it?

Quoted 1 line · Nicholas Krause

You aren't saying what you are doing here in the body of the patch, why not?

Quoted 9 lines
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +0 -0
index 11e915e..e4c8224 100644

drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, · line 67

Quoted 6 lines
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +3 -0
@@ -62,12 +62,14 @@ 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;
+		}

Again, this patch will not apply to the tree, you are making it against your previous patch, which was rejected. There is no way I can take this, right?

Please start over and try again from a "clean" kernel tree.

thanks,

greg k-h