linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Peter Huewe <peterhuewe@gmx.de>
Cc: Rupesh Gujare <rupesh.gujare@atmel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7 v2] staging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)
Date: Fri, 15 Feb 2013 17:52:26 +0300	[thread overview]
Message-ID: <20130215145226.GI6853@mwanda> (raw)
In-Reply-To: <1360938148-19225-3-git-send-email-peterhuewe@gmx.de>

On Fri, Feb 15, 2013 at 03:22:24PM +0100, Peter Huewe wrote:
> This patch fixes the warning "Using plain integer as NULL pointer",
> generated by sparse, by replacing the offending 0s with NULL.
> 
> If the initialization with NULL was unnecessary (due to unconditional
> assignment before first use) it was removed.
> 
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
> @@ -151,7 +151,7 @@ int oz_elt_stream_create(struct oz_elt_buf *buf, u8 id, int max_buf_count)
>  int oz_elt_stream_delete(struct oz_elt_buf *buf, u8 id)
>  {
>  	struct list_head *e;
> -	struct oz_elt_stream *st;
> +	struct oz_elt_stream *st = NULL;
>  	oz_trace("oz_elt_stream_delete(0x%x)\n", id);
>  	spin_lock_bh(&buf->lock);
>  	e = buf->stream_list.next;

You changed the code here.  The original code would crash if
buf->stream_list was empty.  I don't if that can happen, but I still
consider it a bug fix.

Good job, but next time you mention it in the changelog.

You've fixed a couple of these uninitialized variable bugs recently.
Is this is a clang warning?  GCC doesn't catch it.

regards,
dan carpenter


  reply	other threads:[~2013-02-15 14:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15  5:25 [PATCH 1/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer Peter Huewe
2013-02-15  5:25 ` [PATCH 2/7] " Peter Huewe
2013-02-15  5:25 ` [PATCH 3/7] " Peter Huewe
2013-02-15  5:25 ` [PATCH 4/7] " Peter Huewe
2013-02-15  5:25 ` [PATCH 5/7] " Peter Huewe
2013-02-15  5:25 ` [PATCH 6/7] " Peter Huewe
2013-02-15  5:25 ` [PATCH 7/7] " Peter Huewe
2013-02-15  8:45 ` [PATCH 1/7] " Dan Carpenter
2013-02-15 14:22   ` [PATCH 1/7 v2] staging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning) Peter Huewe
2013-02-15 14:22     ` [PATCH 2/7 v2] staging/ozwpan: Fix NULL vs zero in ozusbsvc1.c " Peter Huewe
2013-02-15 14:22     ` [PATCH 3/7 v2] staging/ozwpan: Fix NULL vs zero in ozeltbuf.c " Peter Huewe
2013-02-15 14:52       ` Dan Carpenter [this message]
2013-02-15 15:57         ` Clang Analyzer was " Peter Huewe
2013-02-15 16:11           ` Dan Carpenter
2013-02-15 16:34             ` Peter Hüwe
2013-02-15 14:22     ` [PATCH 4/7 v2] staging/ozwpan: Fix NULL vs zero in ozproto.c " Peter Huewe
2013-02-15 14:22     ` [PATCH 5/7 v2] staging/ozwpan: Fix NULL vs zero in ozcdev.c " Peter Huewe
2013-02-15 14:22     ` [PATCH 6/7] staging/ozwpan: Fix NULL vs zero in ozusbsvc.c " Peter Huewe
2013-02-15 14:22     ` [PATCH 7/7] staging/ozwpan: Fix NULL vs zero in ozhcd.c " Peter Huewe
2013-02-15 18:56       ` Rupesh Gujare
2013-02-15 14:55     ` [PATCH 1/7 v2] staging/ozwpan: Fix NULL vs zero in ozpd.c " Dan Carpenter

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=20130215145226.GI6853@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=rupesh.gujare@atmel.com \
    /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).