Commit 235406dc authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: saa7134: fix saa7134_initdev error handling logic

Smatch reported an issue there:
	drivers/media/pci/saa7134/saa7134-core.c:1302 saa7134_initdev() warn: '&dev->devlist' not removed from list

But besides freeing the list, the media controller graph also
needs to be cleaned up on errors. Address those issues.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 7f9197f1
...@@ -1277,14 +1277,17 @@ static int saa7134_initdev(struct pci_dev *pci_dev, ...@@ -1277,14 +1277,17 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
*/ */
#ifdef CONFIG_MEDIA_CONTROLLER #ifdef CONFIG_MEDIA_CONTROLLER
err = media_device_register(dev->media_dev); err = media_device_register(dev->media_dev);
if (err) if (err) {
media_device_cleanup(dev->media_dev);
goto err_unregister_video; goto err_unregister_video;
}
#endif #endif
return 0; return 0;
err_unregister_video: err_unregister_video:
saa7134_unregister_video(dev); saa7134_unregister_video(dev);
list_del(&dev->devlist);
saa7134_i2c_unregister(dev); saa7134_i2c_unregister(dev);
free_irq(pci_dev->irq, dev); free_irq(pci_dev->irq, dev);
err_iounmap: err_iounmap:
......
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