提交 a9bd87c2 编写于 作者: J Jiri Slaby 提交者: Mauro Carvalho Chehab

[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: NJiri Slaby <jslaby@suse.cz>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 fde04ab9
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册