hackrf: harmless off by one in debug code
Subsystems (3)
PATCH 1/1 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 <[email protected]>
drivers/media/usb/hackrf/hackrf.c +1 -1
@@ -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 ;
Acked-by Antti Palosaari <[email protected]>
Reviewed-by Antti Palosaari <[email protected]>
Antti
Quoted 19 lines · Dan Carpenter
My static checker complains that "i" could be one element beyond the end of the array.
Signed-off-by Dan Carpenter <[email protected]>drivers/media/usb/hackrf/hackrf.c +1
-1@@ -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 ;
Signature · 1 line
http://palosaari.fi/