Re: Trial Patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 14-09-09 06:03 PM, Valdis.Kletnieks@xxxxxx wrote:
> On Tue, 09 Sep 2014 17:16:19 -0400, nick said:
> 
>> I am sending this in again fixed and working.
> 
> Typos are still there, and zero explanation of how you verified
> "fixed and working", which given your track record of failing to
> even compile test your code is a *big* show-stopper.
> 
> If you don't care about your patch enough to even bother fixing
> the typos, why should anybody else care?
> 
>> I also looked at your complain about write_nic_byte and this seems to be
>> there if this succeeds.
> 
> OK.  This is C 101.  How does write_nic_byte() get called if we just did
> the 'return false' and left both the do/while loop and the entire
> function in your patch?
> 
Not going to execute, I wasn't sure if that statement needs to be executed.
Seems it needs to be for the driver to be activated. Thanks for helping
out with my sloppiness :) and being patience. If there are any more problems
let me known.
Nick 
>From ad55b627241203a380dd9c708a4feae98446f85f Mon Sep 17 00:00:00 2001
From: Nicholas Krause <xerofoify@xxxxxxxxx>
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 <xerofoify@xxxxxxxxx>
---
 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->skbwaitQ[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
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux