linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Gustavo F. Padovan" <padovan@profusion.mobi>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] bluetooth: fix error cases
Date: Wed, 1 Jun 2011 14:40:37 -0400	[thread overview]
Message-ID: <20110601184036.GD2509@tuxdriver.com> (raw)
In-Reply-To: <1306910377.3867.5.camel@jlt3.sipsolutions.net>

On Wed, Jun 01, 2011 at 08:39:37AM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> The error cases in a few functions can use a
> socket variable that was never initialised,
> gcc correctly warns about this:
> net/bluetooth/l2cap_core.c: In function ‘l2cap_recv_frame’:
> include/linux/spinlock.h:325:19: warning: ‘sk’ may be used uninitialized in this function [-Wuninitialized]
> net/bluetooth/l2cap_core.c:3789:15: note: ‘sk’ was declared here
> include/linux/spinlock.h:325:19: warning: ‘sk’ may be used uninitialized in this function [-Wuninitialized]
> net/bluetooth/l2cap_core.c:3756:15: note: ‘sk’ was declared here
> 
> Initialise the socket to NULL as clearly intended
> by the error handling code.
> 
> Also fix a "set but not used" warning.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Dave fixed part of these a couple of weeks ago:

commit 6dcae1eaee2b437536b2fe928a609f9589691ebf
Author: David S. Miller <davem@davemloft.net>
Date:   Mon May 16 23:09:26 2011 -0400

    bluetooth: Fix warnings in l2cap_core.c
    
    net/bluetooth/l2cap_core.c: In function ‘l2cap_recv_frame’:
    net/bluetooth/l2cap_core.c:3758:15: warning: ‘sk’ may be used uninitialized 
    net/bluetooth/l2cap_core.c:3758:15: note: ‘sk’ was declared here
    net/bluetooth/l2cap_core.c:3791:15: warning: ‘sk’ may be used uninitialized 
    net/bluetooth/l2cap_core.c:3791:15: note: ‘sk’ was declared here
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

The "set but not used" bit still applies...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

  reply	other threads:[~2011-06-01 18:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  6:39 [PATCH] bluetooth: fix error cases Johannes Berg
2011-06-01 18:40 ` John W. Linville [this message]
2011-06-01 18:48   ` Gustavo F. Padovan

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=20110601184036.GD2509@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=padovan@profusion.mobi \
    /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).