On 14-09-10 12:49 AM, [email protected] wrote:
> On Tue, 09 Sep 2014 23:53:50 -0400, nick said:
>> Build Error. Fixed it. I need to really check my patches first :(.
> 
> How many times have you done that now?
> 
>> In addition, I want you to forget about and not reply to any patches
>> you known I haven't build tested.
> 
> No, it doesn't work like that.  Each broken post counts against you.
> 
>> +            if (skb == NULL) {
>> +                    skb_queue_purge(&priv->rtllib->skb_waitQ[TXCMD_QUEUE]);
>> +                    break;
>> +            }
> 
> Like this one - it's *still* wrong.  Because....
> 
> From: Nicholas Krause <[email protected]>
> Date: Tue, 9 Sep 2014 21:12:56 -0400
> 
> You reposted the same broken patch again.
> 
> Please do the Linux kernel community a favor and seek gainful employment
> in the food service industry or similar, where your skills will be more
> appreciated.
> 
Here is the correct patch.
Nick 
>From ad55b627241203a380dd9c708a4feae98446f85f Mon Sep 17 00:00:00 2001
From: Nicholas Krause <[email protected]>
Date: Tue, 9 Sep 2014 21:12:56 -0400
Subject: [PATCH] staging: Fix NULL check for allocating the skb in
 r8192E_firmware.c

This patch checks in the loop of the function, fw_download_code if
a allocated skb is NULL. If the skb is NULL then we first free the
allocated skbs in the queue of this function with skb_queue_purge
in order to free the allocated skbs. After the freeing of the queue
we break out of the do/while of this function as we need to run
write_nic_byte in order to activate parts of the network card's
driver. 

Signed-off-by: Nicholas Krause <[email protected]>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 1a95d1f..a251414 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -61,6 +61,10 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 		}
 
 		skb  = dev_alloc_skb(frag_length + 4);
+		if (skb == NULL) {
+			skb_queue_purge(&priv->rtllib->skb_waitQ[TXCMD_QUEUE]);
+			break;
+		}
 		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;
-- 
1.9.1

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to