Messages in this thread Patch in this message | | | From | Levente Kurusa <> | Subject | [PATCH 35/38] media: bt8xx: add missing put_device call | Date | Thu, 19 Dec 2013 16:06:49 +0100 |
| |
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> --- drivers/media/pci/bt8xx/bttv-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/pci/bt8xx/bttv-gpio.c b/drivers/media/pci/bt8xx/bttv-gpio.c index 922e823..3f364b7 100644 --- a/drivers/media/pci/bt8xx/bttv-gpio.c +++ b/drivers/media/pci/bt8xx/bttv-gpio.c @@ -98,7 +98,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name) err = device_register(&sub->dev); if (0 != err) { - kfree(sub); + put_device(&sub->dev); return err; } pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev)); -- 1.8.3.1
| |