From: Dan Carpenter Date: Wed, 24 Sep 2014 10:36:39 +0000 (-0300) Subject: [media] hackrf: harmless off by one in debug code X-Git-Tag: omap-for-v3.19/fixes-not-urgent-part1~48^2~12 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=9f93c52783faa24c5c6fca216acf0765ad5d8dd6 [media] hackrf: harmless off by one in debug code My static checker complains that "i" could be one element beyond the end of the array. Signed-off-by: Dan Carpenter Reviewed-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 328b5ba47a0a..fd1fa412e094 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -932,7 +932,7 @@ static int hackrf_set_bandwidth(struct hackrf_dev *dev) dev->bandwidth->val = bandwidth; dev->bandwidth->cur.val = bandwidth; - dev_dbg(dev->dev, "bandwidth selected=%d\n", bandwidth_lut[i].freq); + dev_dbg(dev->dev, "bandwidth selected=%d\n", bandwidth); u16tmp = 0; u16tmp |= ((bandwidth >> 0) & 0xff) << 0;