linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [media] hackrf: harmless off by one in debug code
@ 2014-09-24 10:36 Dan Carpenter
  2014-09-24 10:48 ` Antti Palosaari
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-09-24 10:36 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

My static checker complains that "i" could be one element beyond the end
of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
index 328b5ba..fd1fa41 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] [media] hackrf: harmless off by one in debug code
  2014-09-24 10:36 [patch] [media] hackrf: harmless off by one in debug code Dan Carpenter
@ 2014-09-24 10:48 ` Antti Palosaari
  0 siblings, 0 replies; 2+ messages in thread
From: Antti Palosaari @ 2014-09-24 10:48 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>

Antti

On 09/24/2014 01:36 PM, Dan Carpenter wrote:
> My static checker complains that "i" could be one element beyond the end
> of the array.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
> index 328b5ba..fd1fa41 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;
>

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-24 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 10:36 [patch] [media] hackrf: harmless off by one in debug code Dan Carpenter
2014-09-24 10:48 ` Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).