Commit d3db22e1 authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

[media] dib0700: Fix memory leak during initialization

Reported by kmemleak.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3ef76759
...@@ -679,6 +679,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) ...@@ -679,6 +679,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
deb_info("%s()\n", __func__); deb_info("%s()\n", __func__);
if (d->rc_dev == NULL) { if (d->rc_dev == NULL) {
/* This will occur if disable_rc_polling=1 */ /* This will occur if disable_rc_polling=1 */
kfree(purb->transfer_buffer);
usb_free_urb(purb); usb_free_urb(purb);
return; return;
} }
...@@ -687,6 +688,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) ...@@ -687,6 +688,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
if (purb->status < 0) { if (purb->status < 0) {
deb_info("discontinuing polling\n"); deb_info("discontinuing polling\n");
kfree(purb->transfer_buffer);
usb_free_urb(purb); usb_free_urb(purb);
return; return;
} }
...@@ -781,8 +783,11 @@ int dib0700_rc_setup(struct dvb_usb_device *d) ...@@ -781,8 +783,11 @@ int dib0700_rc_setup(struct dvb_usb_device *d)
dib0700_rc_urb_completion, d); dib0700_rc_urb_completion, d);
ret = usb_submit_urb(purb, GFP_ATOMIC); ret = usb_submit_urb(purb, GFP_ATOMIC);
if (ret) if (ret) {
err("rc submit urb failed\n"); err("rc submit urb failed\n");
kfree(purb->transfer_buffer);
usb_free_urb(purb);
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment