[media] MEDIA: ttusbir, fix double free

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>
This commit is contained in:
Jiri Slaby 2013-04-04 16:32:09 -03:00 коммит произвёл Mauro Carvalho Chehab
Родитель fde04ab95d
Коммит a9bd87c232
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -347,6 +347,7 @@ static int ttusbir_probe(struct usb_interface *intf,
return 0; return 0;
out3: out3:
rc_unregister_device(rc); rc_unregister_device(rc);
rc = NULL;
out2: out2:
led_classdev_unregister(&tt->led); led_classdev_unregister(&tt->led);
out: out: