kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: hugo@carfax.org.uk (Hugo Mills)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Trial Patch
Date: Wed, 10 Sep 2014 12:36:16 +0100	[thread overview]
Message-ID: <20140910113616.GG5783@carfax.org.uk> (raw)
In-Reply-To: <54103568.4010208@gmail.com>

On Wed, Sep 10, 2014 at 07:26:32AM -0400, nick wrote:
> On 14-09-10 12:49 AM, Valdis.Kletnieks at vt.edu wrote:
[snip]
> > Like this one - it's *still* wrong.  Because....
> > 
> > From: Nicholas Krause <xerofoify@gmail.com>
> > Date: Tue, 9 Sep 2014 21:12:56 -0400
> > 
> > You reposted the same broken patch again.
[snip]
> Here is the correct patch.
> Nick 

> >From ad55b627241203a380dd9c708a4feae98446f85f Mon Sep 17 00:00:00 2001
> From: Nicholas Krause <xerofoify@gmail.com>
> 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@gmail.com>
> ---
>  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;

   I'll save Valdis the trouble here. This is still wrong. It's
*identical* to the last one you sent. Bit for bit. Again, you've lost
track of even the most fundamental details ("Am I sending the thing I
wanted to?")

   Doing this once or twice, occasionally, is OK. Everyone makes
mistakes every so often. Doing it repeatedly, on a nearly daily basis,
over a period of a couple of months, is simply unacceptable.

   Hugo.

-- 
=== Hugo Mills: hugo at ... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- Our so-called leaders speak/with words they try to jail ya/ ---   
        They subjugate the meek/but it's the rhetoric of failure.        
                                                                         
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140910/1f99dd13/attachment.bin 

  reply	other threads:[~2014-09-10 11:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  3:08 Trial Patch nick
2014-09-09  4:04 ` Valdis.Kletnieks at vt.edu
2014-09-09 12:22 ` nick
2014-09-09 12:42   ` Sudip Mukherjee
2014-09-09 13:24     ` nick
2014-09-09 13:39       ` Sudip Mukherjee
2014-09-09 13:26   ` Valdis.Kletnieks at vt.edu
2014-09-09 13:45 ` Greg Freemyer
2014-09-09 13:54   ` Peter Senna Tschudin
2014-09-09 15:52     ` Nick Krause
2014-09-09 16:40       ` Valdis.Kletnieks at vt.edu
2014-09-09 21:16         ` nick
2014-09-09 21:33           ` Hugo Mills
2014-09-09 22:03           ` Valdis.Kletnieks at vt.edu
2014-09-10  1:21             ` nick
2014-09-10  2:52               ` Valdis.Kletnieks at vt.edu
2014-09-10  2:56                 ` nick
2014-09-10  3:07                   ` Valdis.Kletnieks at vt.edu
2014-09-10  3:11                     ` nick
2014-09-10  3:53                       ` nick
2014-09-10  4:49                         ` Valdis.Kletnieks at vt.edu
2014-09-10 11:26                           ` nick
2014-09-10 11:36                             ` Hugo Mills [this message]
2014-09-10 11:38                             ` Kristofer Hallin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140910113616.GG5783@carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).