Search Linux Wireless

Re: [PATCH] bluetooth: fix error cases

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

 



On Wed, Jun 01, 2011 at 08:39:37AM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
> 
> 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@xxxxxxxxx>

Dave fixed part of these a couple of weeks ago:

commit 6dcae1eaee2b437536b2fe928a609f9589691ebf
Author: David S. Miller <davem@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>

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

-- 
John W. Linville		Someday the world will need a hero, and you
linville@xxxxxxxxxxxxx			might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux