[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9e1b48aeaf261e37aa99d868c44acfe7df0d7fc4.1623846327.git.mchehab+huawei@kernel.org>
Date: Wed, 16 Jun 2021 14:28:32 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@...wei.com, mauro.chehab@...wei.com,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Julia Lawall <Julia.Lawall@...ia.fr>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Tasos Sahanidis <tasos@...ossah.com>,
Vaibhav Gupta <vaibhavgupta40@...il.com>,
Yang Yingliang <yangyingliang@...wei.com>,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org
Subject: [PATCH 06/11] 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: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
drivers/media/pci/saa7134/saa7134-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c
index 97b1767f1fff..47158ab3956b 100644
--- a/drivers/media/pci/saa7134/saa7134-core.c
+++ b/drivers/media/pci/saa7134/saa7134-core.c
@@ -1277,14 +1277,17 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
*/
#ifdef CONFIG_MEDIA_CONTROLLER
err = media_device_register(dev->media_dev);
- if (err)
+ if (err) {
+ media_device_cleanup(dev->media_dev);
goto err_unregister_video;
+ }
#endif
return 0;
err_unregister_video:
saa7134_unregister_video(dev);
+ list_del(&dev->devlist);
saa7134_i2c_unregister(dev);
free_irq(pci_dev->irq, dev);
err_iounmap:
--
2.31.1
Powered by blists - more mailing lists