From patchwork Mon Jun 20 05:31:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 84215 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1o3A15-00BM7J-0Q; Mon, 20 Jun 2022 05:32:03 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238290AbiFTFcB (ORCPT + 1 other); Mon, 20 Jun 2022 01:32:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiFTFcA (ORCPT ); Mon, 20 Jun 2022 01:32:00 -0400 Received: from smtp.smtpout.orange.fr (smtp10.smtpout.orange.fr [80.12.242.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B546F95AA for ; Sun, 19 Jun 2022 22:31:57 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id 3A0woCV0J0JIm3A0xoG8j4; Mon, 20 Jun 2022 07:31:55 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Mon, 20 Jun 2022 07:31:55 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Ezequiel Garcia , Mauro Carvalho Chehab , Hans Verkuil , Zheyu Ma Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-media@vger.kernel.org Subject: [PATCH v2] media: tw686x: Fix an error handling path in tw686x_probe() Date: Mon, 20 Jun 2022 07:31:53 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no The commit in Fixes: is incomplete. It has moved some code in the probe but not all error handling paths have been updated. Now, if 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 --- v2: Fix a typo in the log message Fix a typo in the label s/868/686/ --- drivers/media/pci/tw686x/tw686x-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 tw686x_free; } pci_set_drvdata(pci_dev, dev); return 0; +tw686x_free: + tw686x_video_free(dev); + tw686x_audio_free(dev); iounmap: pci_iounmap(pci_dev, dev->mmio); free_region: