Search Linux Wireless

Re: [PATCHv2.1] wireless: at76c50x: use native hex_pack_byte() method

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

 



On Tue, 27 Sep 2011 15:01:49 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Cc: "John W. Linville" <linville@xxxxxxxxxxxxx>
> Cc: linux-wireless@xxxxxxxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx
> ---
>  drivers/net/wireless/at76c50x-usb.c |   18 +++++++-----------
>  1 files changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/at76c50x-usb.c

...

> b/drivers/net/wireless/at76c50x-usb.c index 2986014..2dde5f6 100644
> -		*obuf++ = BIN2HEX(*ibuf >> 4);
> -		*obuf++ = BIN2HEX(*ibuf & 0xf);
> +		obuf = pack_hex_byte(obuf, *ibuf++);
>  		*obuf++ = '-';
> -		ibuf++;
>  	}
> -	*(--obuf) = '\0';
> +
> +	if (*obuf == '-')
> +		obuf--;

This will access uninitialized data and fail to strip the final "-" in
most cases.  The check for len being 0 was there for a reason.  Please
actually test your code.

NACK

By the way, I don't think it's necessary to copy linux-kernel and
netdev about a change affecting just a wireless driver.

-- 
Regards,
Pavel Roskin
--
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