From patchwork Sat Jan 27 12:40:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 10187445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55C7B60385 for ; Sat, 27 Jan 2018 12:43:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 485A028C4A for ; Sat, 27 Jan 2018 12:43:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B59928C67; Sat, 27 Jan 2018 12:43:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E83928C4A for ; Sat, 27 Jan 2018 12:43:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A13D9266D71; Sat, 27 Jan 2018 13:43:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CFDFB266D7D; Sat, 27 Jan 2018 13:43:11 +0100 (CET) Received: from smtp.smtpout.orange.fr (smtp01.smtpout.orange.fr [80.12.242.123]) by alsa0.perex.cz (Postfix) with ESMTP id BD289266C0E for ; Sat, 27 Jan 2018 13:43:08 +0100 (CET) Received: from linux.numericable.fr ([77.198.79.136]) by mwinf5d48 with ME id 3Qj61x0022wTeBR03Qj6kS; Sat, 27 Jan 2018 13:43:08 +0100 X-ME-Helo: linux.numericable.fr X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 27 Jan 2018 13:43:08 +0100 X-ME-IP: 77.198.79.136 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, arvind.yadav.cs@gmail.com Date: Sat, 27 Jan 2018 13:40:28 +0100 Message-Id: <20180127124028.3795-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 X-Antivirus: Avast (VPS 180126-6, 26/01/2018), Outbound message X-Antivirus-Status: Clean Cc: Christophe JAILLET , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: Intel: Fix some error handling path in 'sst_platform_get_resources()' X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Several error handling paths set 'ret' to an error code, but the function always returns 0 (i.e. success) Return 'ret' instead in order to return the error code. Signed-off-by: Christophe JAILLET --- I guess that the code needs more correction. For this first try, I've left the logic as-is, but I don't really see why we call 'pci_release_regions()' in the normal path. A 'return 0;' before the 'do_release_regions' label would sound more logical to me. --- sound/soc/intel/atom/sst/sst_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c index 6906ee624cf6..8cae20802b7c 100644 --- a/sound/soc/intel/atom/sst/sst_pci.c +++ b/sound/soc/intel/atom/sst/sst_pci.c @@ -105,9 +105,12 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) goto do_release_regions; } dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram); + + ret = 0; + do_release_regions: pci_release_regions(pci); - return 0; + return ret; } /*