[media] media: fix au0828_analog_register() to not free au0828_dev
authorShuah Khan <shuahkh@osg.samsung.com>
Sun, 21 Dec 2014 03:24:48 +0000 (00:24 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 2 Feb 2015 13:56:55 +0000 (11:56 -0200)
au0828_analog_register() frees au0828_dev when it fails to
locate isoc endpoint. au0828_usb_probe() continues with dvb
and rc probe and registration assuming dev is still valid.
When au0828_analog_register() fails to locate isoc endpoint,
it should return without free'ing au0828_dev. Otherwise, the
probe will fail as dev is null when au0828_dvb_register() is
called.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/au0828/au0828-video.c

index 60a68460045627557365b7ff5c23c4cb40f99395..98abfd6206248fb7c4a0373f820b0d6d9c9a373b 100644 (file)
@@ -2029,7 +2029,6 @@ int au0828_analog_register(struct au0828_dev *dev,
        }
        if (!(dev->isoc_in_endpointaddr)) {
                pr_info("Could not locate isoc endpoint\n");
-               kfree(dev);
                return -ENODEV;
        }