Skip to content

Commit

Permalink
[media] dib0700: Fix memory leak during initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Mar 19, 2012
1 parent 3ef7675 commit d3db22e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/media/dvb/dvb-usb/dib0700_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d3db22e

Please sign in to comment.