From patchwork Sat Nov 18 09:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064697 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 001C86023A for ; Sat, 18 Nov 2017 09:58:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E32182A304 for ; Sat, 18 Nov 2017 09:58:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7FAE2A895; Sat, 18 Nov 2017 09:58:14 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6BA572A304 for ; Sat, 18 Nov 2017 09:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AoybOm8GPt7PWJmEiy4ECOxCFnyFCv0lzQekOjCq+HM=; b=HpizJ7HX/Ec8kIqEJvfRDAnbAn AcYCL1D5fQMbBka6g1aPmXo516AUKD19ItADy+CgDOE5EvyvV+PmdtLc+TyIZ0T8blewnE+SxwjEy nHMq74dHfsvhs2pJ8inFcCeWiaGLpDJNnA9+xRgob8gA3V+0pnak1EjndxShsTlenc6pBPsFOlnI8 eUX8E88pBK9yeGCWRNYyVAyv9YzQ8StqP/xKmUg2HF9DzwwDLZGMORoq0EOWjttQSsibe34Xgu39C HVSpXsXrs/IlPnPQahfJTn7YcEGRf1GAOEgK8CdDdH8IlLpTQRk/QJ3blyUSK1bvgCRAIBkizo/zC OgMh+y7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eFzt7-0003Lm-Hb; Sat, 18 Nov 2017 09:58:13 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzsQ-0002dA-QW; Sat, 18 Nov 2017 09:57:38 +0000 Received: by mail-pg0-x243.google.com with SMTP id u3so3775576pgn.7; Sat, 18 Nov 2017 01:57:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=acr9J5300nPLQa5KUpY9HlwrF/T1EGWGRa0HyT7Py2w=; b=qNYGVzD4kP+9rQh+yBYIqPbee0mji73Sj7YCApl74y0DC3h6wAqvTj110ByymrUNuR 4pkcDGVDB8Hqmn4vU5VUt9BmTnENaAauyDq0RzDtamW7ihlfrysB5hBjvt23yzwCDwUd tUMDyscNSLDISb4nhtUBarXLD77Ta9Nf8Pbx+majvcW9z94BOl0I36iyUTRqxlRfkJEX vH6Rqu758TlWO8ftQzPJqsrMAI+UHQppad+Yjh+RxYkcoUaormej9bB9EU/Q0D6wHkVw lyiX+Fo6jJ7mrARAbQN5hrVM7eOWTXD+DAc7JaCTP59wkjw2YRMJgOunmMuxM5uK/ejY 0PrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=acr9J5300nPLQa5KUpY9HlwrF/T1EGWGRa0HyT7Py2w=; b=Jqp5uIJegC3085vZ7pMJh9aT5MqcuPyblbZFxXoxI8lDvgO865t53WRZFPAjJzW6y3 5ouEed8gzSanwhDycRPrtWiA09QdOQnjEQQWNF//6ZeRKrcEM6cJ8tvBKqkUmCeLDCre kU4xEU4foWFflLvWyxWzw/lLZPHbKKn72G5P8awXiKfhp4g9w14Q8D8bRvSzwGsAU4yt KqrcPyx+1OeWP01EOsvk9qYSXoytqPkdTH7QaMmyNxZJOCHDymzPm6Y8h6tqjAvfTAgC 07GNYpFMtgctesi983+jY/Y9uEL7es0nk9girT0Dhbdfl7tp7tY2lVtqGUjkhAwD5fS+ K4bg== X-Gm-Message-State: AJaThX50o4rZ7NJvKtRxmX6HvD23x1kmTtYpOs7N6iHfi1riqrf0mKHi YhMVzrmye8YGFbRrmmrHnMA= X-Google-Smtp-Source: AGs4zMa5ZcPg+yrUUf/tDIM8xOJJhTPR72PRUw5Spha5B/4yaojAUsOnl2lOZGhGKdNKBPRuMXvHaw== X-Received: by 10.159.208.2 with SMTP id a2mr8096804plp.370.1510999030036; Sat, 18 Nov 2017 01:57:10 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id r16sm8862577pgt.72.2017.11.18.01.57.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:57:09 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, linux@armlinux.org.uk Subject: [PATCH 4/5 v2] ASoC: intel: sst: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 15:26:48 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> In-Reply-To: <37f7370f99f4efa12f92eaeada72ff511d409fa6.1510997815.git.arvind.yadav.cs@gmail.com> References: <37f7370f99f4efa12f92eaeada72ff511d409fa6.1510997815.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_015731_223851_ABAB7255 X-CRM114-Status: UNSURE ( 8.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. sound/soc/intel/atom/sst/sst_acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index 32d6e02..693b970 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -236,6 +236,9 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) /* Find the IRQ */ ctx->irq_num = platform_get_irq(pdev, ctx->pdata->res_info->acpi_ipc_irq_index); + if (ctx->irq_num <= 0) + return ctx->irq_num; + return 0; }