If there is not enough memory the allocated urb_list will not be freed.

Signed-off-by: Manoel Pinheiro <[email protected]>
---
 drivers/media/dvb/dvb-usb/usb-urb.c |    4 ++--
 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 86d6893..d62ee0f 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;
                }
 
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to