Commit a757097c authored by Philipp Zabel's avatar Philipp Zabel Committed by Kamal Mostafa

[media] coda: fix error path in case of missing pdata on non-DT platform

commit bc717d5e upstream.

If we bail out this early, v4l2_device_register() has not been called
yet, so no need to call v4l2_device_unregister().

Fixes: b7bd660a ("[media] coda: Call v4l2_device_unregister() from a single location")
Reported-by: default avatarMichael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 1c5e35a4
......@@ -2035,14 +2035,12 @@ static int coda_probe(struct platform_device *pdev)
pdev_id = of_id ? of_id->data : platform_get_device_id(pdev);
if (of_id) {
if (of_id)
dev->devtype = of_id->data;
} else if (pdev_id) {
else if (pdev_id)
dev->devtype = &coda_devdata[pdev_id->driver_data];
} else {
ret = -EINVAL;
goto err_v4l2_register;
}
else
return -EINVAL;
spin_lock_init(&dev->irqlock);
INIT_LIST_HEAD(&dev->instances);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment