summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2012-03-13 13:52:50 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-19 19:35:57 -0300
commitd3db22e10bd4997d244beee6feea5fa39b2e5b82 (patch)
tree3cd18898d996e20d2520361cf89237ac27d91b9f /drivers/media
parent3ef76759484832e498cba381aa1b24b90cf36a26 (diff)
[media] dib0700: Fix memory leak during initialization
Reported by kmemleak. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index ae4f999930fa..02290c60f72f 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -679,6 +679,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
deb_info("%s()\n", __func__);
if (d->rc_dev == NULL) {
/* This will occur if disable_rc_polling=1 */
+ kfree(purb->transfer_buffer);
usb_free_urb(purb);
return;
}
@@ -687,6 +688,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
if (purb->status < 0) {
deb_info("discontinuing polling\n");
+ kfree(purb->transfer_buffer);
usb_free_urb(purb);
return;
}
@@ -781,8 +783,11 @@ int dib0700_rc_setup(struct dvb_usb_device *d)
dib0700_rc_urb_completion, d);
ret = usb_submit_urb(purb, GFP_ATOMIC);
- if (ret)
+ if (ret) {
err("rc submit urb failed\n");
+ kfree(purb->transfer_buffer);
+ usb_free_urb(purb);
+ }
return ret;
}