Skip to content

Commit

Permalink
[media] MEDIA: ttusbir, fix double free
Browse files Browse the repository at this point in the history
rc_unregister_device already calls rc_free_device to free the passed
device. But in one of ttusbir's probe fail paths, we call
rc_unregister_device _and_ rc_free_device. This is wrong and results
in a double free.
Instead, set rc to NULL resulting in rc_free_device being a noop.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed Apr 8, 2013
1 parent fde04ab commit a9bd87c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/rc/ttusbir.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ static int ttusbir_probe(struct usb_interface *intf,
return 0;
out3:
rc_unregister_device(rc);
rc = NULL;
out2:
led_classdev_unregister(&tt->led);
out:
Expand Down

0 comments on commit a9bd87c

Please sign in to comment.