diff mbox series

media: tw686x: Fix an error handling path in tw686x_probe()

Message ID c72fe5a6f5944820de52e4957bc1d804bd214a66.1655673905.git.christophe.jaillet@wanadoo.fr
State Accepted
Commit 978bbc392c51e0ece959978daa0ad7fb4dd7f932
Headers show
Series media: tw686x: Fix an error handling path in tw686x_probe() | expand

Commit Message

Christophe JAILLET June 19, 2022, 9:25 p.m. UTC
The commit in Fixes is incomplete. It has moved some code in the probe but
not all error handling path have been updated.

Now, ff request_irq() fails we must release some resources.

Fixes: c8946454ed96 ("media: tw686x: Register the irq at the end of probe")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/pci/tw686x/tw686x-core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c
index 384d38754a4b..af83ebf8eea4 100644
--- a/drivers/media/pci/tw686x/tw686x-core.c
+++ b/drivers/media/pci/tw686x/tw686x-core.c
@@ -337,12 +337,15 @@  static int tw686x_probe(struct pci_dev *pci_dev,
 			  dev->name, dev);
 	if (err < 0) {
 		dev_err(&pci_dev->dev, "unable to request interrupt\n");
-		goto iounmap;
+		goto tw868x_free;
 	}
 
 	pci_set_drvdata(pci_dev, dev);
 	return 0;
 
+tw868x_free:
+	tw686x_video_free(dev);
+	tw686x_audio_free(dev);
 iounmap:
 	pci_iounmap(pci_dev, dev->mmio);
 free_region: