[media] media: bt8xx: add missing put_device call
This is required so that we give up the last reference to the device. Remove the kfree() because the put_device() call will actually call release_sub_device which in turn kfrees the device. Signed-off-by: Levente Kurusa <levex@linux.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
parent
656e62dc84
commit
38121b6ef3
@ -98,7 +98,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name)
|
|||||||
|
|
||||||
err = device_register(&sub->dev);
|
err = device_register(&sub->dev);
|
||||||
if (0 != err) {
|
if (0 != err) {
|
||||||
kfree(sub);
|
put_device(&sub->dev);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev));
|
pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev));
|
||||||
|
Loading…
Reference in New Issue
Block a user