media: cedrus: Fix failure to clean up hardware on probe failure

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2020-04-26 14:38:15 -05:00 committed by orangepi-xunlong
parent 541451e333
commit 05604793ce

View File

@ -472,7 +472,7 @@ static int cedrus_probe(struct platform_device *pdev)
ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
if (ret) {
dev_err(&pdev->dev, "Failed to register V4L2 device\n");
return ret;
goto err_hw;
}
vfd = &dev->vfd;
@ -533,6 +533,8 @@ err_m2m:
v4l2_m2m_release(dev->m2m_dev);
err_v4l2:
v4l2_device_unregister(&dev->v4l2_dev);
err_hw:
cedrus_hw_remove(dev);
return ret;
}