From patchwork Sat Aug 6 04:52:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoel Pinheiro X-Patchwork-Id: 1040992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p764woc4015350 for ; Sat, 6 Aug 2011 04:58:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751059Ab1HFE5c (ORCPT ); Sat, 6 Aug 2011 00:57:32 -0400 Received: from blu0-omc2-s26.blu0.hotmail.com ([65.55.111.101]:6133 "EHLO blu0-omc2-s26.blu0.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835Ab1HFE5c (ORCPT ); Sat, 6 Aug 2011 00:57:32 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 06 Aug 2011 04:58:50 +0000 (UTC) X-Greylist: delayed 332 seconds by postgrey-1.27 at vger.kernel.org; Sat, 06 Aug 2011 00:57:32 EDT Received: from BLU0-SMTP400 ([65.55.111.73]) by blu0-omc2-s26.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 5 Aug 2011 21:51:58 -0700 X-Originating-IP: [189.78.49.252] X-Originating-Email: [pinusdtv@hotmail.com] Message-ID: Received: from localhost.localdomain ([189.78.49.252]) by BLU0-SMTP400.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 5 Aug 2011 21:51:57 -0700 From: Manoel Pinheiro To: linux-media@vger.kernel.org CC: mchehab@redhat.com Subject: [PATCH] usb-urb.c: usb_bulk_urb_init and usb_isoc_urb_init Date: Sat, 6 Aug 2011 01:52:12 -0300 X-Mailer: git-send-email 1.7.4.4 X-OriginalArrivalTime: 06 Aug 2011 04:51:58.0049 (UTC) FILETIME=[926AA510:01CC53F4] MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If there is not enough memory the allocated urb_list will not be freed. Signed-off-by: Manoel Pinheiro --- 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; }