On Tue, 2011-09-27 at 15:47 -0400, Pavel Roskin wrote: > 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. In case of len == 0 we have either '\0' or hex digit in the first byte of the array. Otherwise it's a mess in the memory which should not be happened. > > 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. > -- Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Intel Finland Oy -- 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