kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: sudipm.mukherjee@gmail.com (Sudip Mukherjee)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Trial Patch
Date: Tue, 9 Sep 2014 18:12:54 +0530	[thread overview]
Message-ID: <20140909124254.GA25180@sudip-PC> (raw)
In-Reply-To: <540EF123.8060809@gmail.com>

On Tue, Sep 09, 2014 at 08:22:59AM -0400, nick wrote:
> 
> 
> On 14-09-08 11:08 PM, nick wrote:
> > I am attaching a trial patch again , please let me known if there are any issues for me to fix.
> > Nick 
> > 
> This patch is wrong, checkpatch errors. I am attaching another fixed version.
> Sorry Nick 

> >From 1d6378589ab97cc646e2a3717413077453e4e80b Mon Sep 17 00:00:00 2001
> From: Nicholas Krause <xerofoify@gmail.com>
> Date: Mon, 8 Sep 2014 21:30:37 -0400
> Subject: [PATCH] staging: Fix Null check for allocating skb in r8192E_firmware.c
> 
> This patch checks in fw_download_code for if the allocated skb is
> NULl. Further more if the skb is null and we are in the loop,
> clean up and dequeune the skb quenue. In additon return false
> directly in the if statement and return true by itself removing
> rt_status to improve the code's readablitiy of return statements
> in fw_download_code.
> 

lots of spelling mistake .. what is NuLl ? 

> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
> index 1a95d1f..6988e1c 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
> @@ -36,7 +36,6 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
>  			     u32 buffer_len)
>  {
>  	struct r8192_priv *priv = rtllib_priv(dev);
> -	bool		    rt_status = true;
>  	u16		    frag_threshold;
>  	u16		    frag_length, frag_offset = 0;
>  	int		    i;
> @@ -61,6 +60,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_dequeue(&priv->rtllib->skb_waitQ[TXCMD_QUEUE]);

	again checkpatch warning of line over 80 char

> +				return false;
> +		}
>  		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;
> @@ -99,7 +102,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
>  
>  	write_nic_byte(dev, TPPoll, TPPoll_CQ);
>  
> -	return rt_status;
> +	return true;
>  }
>  
>  static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
> -- 
> 1.9.1
> 

> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2014-09-09 12:42 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 [this message]
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
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=20140909124254.GA25180@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --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).