Re: [PATCH BlueZ] btmgmt: fix used without initialization

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

 



Hi Johan,

On Mon, Nov 7, 2011 at 3:36 PM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:
> Hi Claudio,
>
> On Mon, Nov 07, 2011, Claudio Takahasi wrote:
>> This patch fixes the following warning being treated as error:
>> mgmt/main.c: In function 'mgmt_process_data':
>> mgmt/main.c:508:3: error: 'len' may be used uninitialized in this
>> function [-Werror=uninitialized]
>> ---
>>  mgmt/main.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> Thanks for the heads-up. Seems like my gcc is buggy since it doesn't
> catch this even when I use bootstrap-configure. The original intent of
> the code was to have return ret which is what I pushed as a fix (-errno
> would be more sophisticated but then it'd make sense to fix several
> other places in the code too). Btw, please keep "int err" variables
> negative so that we have consistency in the code-base and avoid stupid
> bugs.

Actually we are not consistent yet:

$ grep -r 'int err.*errno;' *
audio/avdtp.c:		int err = -errno;
audio/avdtp.c:		int err = -errno;
btio/btio.c:		int error = -errno;
btio/btio.c:		int error = -errno;
btio/btio.c:		int error = -errno;
network/common.c:		int err = errno;
network/common.c:		int err = errno;
network/common.c:		int err = errno;
serial/port.c:		int err = -errno;
serial/port.c:		int err = -errno;
time/server.c:		int err = errno;   (*)
tools/hcitool.c:		int err = errno;

This one is from a patch I sent (not yet applied), will fix.

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux