summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/usb-urb.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2011-07-28 09:46:02 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-27 11:14:15 -0300
commiteb28dc39d3e82674584cc768b9757d1cae222a52 (patch)
tree0bc832e66e0629a35c818d87607861e4be3ca610 /drivers/media/dvb/dvb-usb/usb-urb.c
parent93165b7774a04cf76bc46eb6c9181ab7a8b545d7 (diff)
downloadtalos-op-linux-eb28dc39d3e82674584cc768b9757d1cae222a52.tar.gz
talos-op-linux-eb28dc39d3e82674584cc768b9757d1cae222a52.zip
[media] drivers/media/dvb/dvb-usb/usb-urb.c: adjust array index
Convert array index from the loop bound to the loop index. A simplified version of the semantic patch that fixes this problem is as // <smpl> @@ expression e1,e2,ar; @@ for(e1 = 0; e1 < e2; e1++) { <... ar[ - e2 + e1 ] ...> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/usb-urb.c')
-rw-r--r--drivers/media/dvb/dvb-usb/usb-urb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index 86d68933b6b4..d62ee0f5a165 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -148,7 +148,7 @@ static int usb_bulk_urb_init(struct usb_data_stream *stream)
if (!stream->urb_list[i]) {
deb_mem("not enough memory for urb_alloc_urb!.\n");
for (j = 0; j < i; j++)
- usb_free_urb(stream->urb_list[i]);
+ usb_free_urb(stream->urb_list[j]);
return -ENOMEM;
}
usb_fill_bulk_urb( stream->urb_list[i], stream->udev,
@@ -181,7 +181,7 @@ static int usb_isoc_urb_init(struct usb_data_stream *stream)
if (!stream->urb_list[i]) {
deb_mem("not enough memory for urb_alloc_urb!\n");
for (j = 0; j < i; j++)
- usb_free_urb(stream->urb_list[i]);
+ usb_free_urb(stream->urb_list[j]);
return -ENOMEM;
}
OpenPOWER on IntegriCloud