[media] media: bt8xx: add missing put_device call
authorLevente Kurusa <levex@linux.com>
Thu, 19 Dec 2013 15:06:49 +0000 (12:06 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 4 Feb 2014 08:27:38 +0000 (06:27 -0200)
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>
drivers/media/pci/bt8xx/bttv-gpio.c

index 922e8233fd0b88dbed55c284342edfa7c9b23cf0..3f364b7062b915445bf952b84dc1a64950b2ba02 100644 (file)
@@ -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));