From patchwork Sun Nov 19 04:15:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10065021 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 2ADC2602CB for ; Sun, 19 Nov 2017 04:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18F802952A for ; Sun, 19 Nov 2017 04:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DBE129530; Sun, 19 Nov 2017 04:19:19 +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 B9F4B2952A for ; Sun, 19 Nov 2017 04:19:18 +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=4amhE2E36tFGTyZKceV4P0pdjKFfw57d/T4A6AF+o1k=; b=sofRzr9zn8SsD44AWYZljJesDO S1xxQhAKEcIjzDGq6gAoSCaNfD/PVFnePd3qp2PybeA1K5/MaYNVSLXHczjYbzot3JVn0U4yNQc1S 24CMgJSkrQgQAaz7IP56YhOHMukhnoWmLiRe1MaDU5t0h8kokgOCOX6HVOwRo7wNIuFbOWQlj1YLn JhuZTZNox8hJlz5KqL6JX33TZ+8ZxaZ4g7CGJyAvMtrhb4qP71MKTYVuDG3Nkc6DeJX95NQzH90YP 86ntQU7ShvR0xfwEH/fpH4tgubl+dEajq/5cyTu/dqNNaqcYtvUhb9x7qfkRt8sgkYrJRXoQaMBFJ Q6ELrrHg==; 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 1eGH4f-0001YA-Gi; Sun, 19 Nov 2017 04:19:17 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eGH1O-0007Uy-NR; Sun, 19 Nov 2017 04:15:56 +0000 Received: by mail-pf0-x244.google.com with SMTP id j28so4828943pfk.8; Sat, 18 Nov 2017 20:15:33 -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=wZmY6fIuB2q5ipkNwgA1yVWrm0j8KoDeQjdFnsRa3bE=; b=vTyTWTv6BoFNNyX8ObGPmfg4Bp1jcLKpFcHZlFPUg+gCB7BNQiXki40KtZDJ+gr9Ka orT0wQfKIDvC4LzQEGLsmW13j73eSOB5nPbgGg20qOEQqSl/v036+pZVSy5VY+LIC3WT lFVwSJyM/GCw0AHqDofsX7y1LF2PnV7LHeDwlHXyQaB6qc5KAMQfzJ2kOypjQJHZQKx3 DsXR0jhLcmTfuVbNctN5gaQPcgdSVIu3CzxBY5SncSvld3lI6NhzKU/AEnnSKt0NnmTE 7HGcGvuSeCkAjWBzT+3TLta5m99DCQBWIKUH0xL9to/1HriiYzczNGgLTsY/sqCcNqHx FpyQ== 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=wZmY6fIuB2q5ipkNwgA1yVWrm0j8KoDeQjdFnsRa3bE=; b=mkKbd9lC5meDPR3TAgajl3bS+vxMLDJANzbXd4u4+5U3PzA3cIMtE2NRYYrCII0amY AgIrWppKWSXx7I/9+xg+JaWgYQp+lTJXJyG20MXUiLGbnrrr0jgLuDawk198pLl0Z2va XP5lJz2UEFo41fqKgcDExPj8iFj6scnWieZsXXmhUdXAmJmXKrcDe+DazBAIDl0z3Ye8 9Go6leE4DKoNu+Z/d+6gucGB3E0SCXr1FWt/096+J7qDvuQXWaSBxNeRiXpCtb+ouXVb 8BTPqmJ7wSEbBeYAt+4wvMuWR+4T/SyRu2ax3YjObmcrbkFzIxA2LU3rSDlMDylhb1+h Rrmw== X-Gm-Message-State: AJaThX47nUAlGDgXl2eM6nOzlGGrSp2HfEgJfI9/CxERwGCo6zkWrXXj rnuL2RLn2ZDFeVRLmrfVd2w= X-Google-Smtp-Source: AGs4zMZDtQ2pneB9IfNqVUKowO03xge7dX5mJzGGDTNgTgwcHlj5A/Q3xH/aQBhenJ43iUBhvUxFtQ== X-Received: by 10.84.240.6 with SMTP id y6mr9554182plk.301.1511064933474; Sat, 18 Nov 2017 20:15:33 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id l14sm12741475pgn.35.2017.11.18.20.15.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:15:32 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux@armlinux.org.uk Subject: [PATCH 4/5 v3] ASoC: intel: sst: Handle return value of platform_get_irq Date: Sun, 19 Nov 2017 09:45:03 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> References: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> In-Reply-To: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> References: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_201554_885607_DD64E9B4 X-CRM114-Status: UNSURE ( 9.41 ) 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-kernel@vger.kernel.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. changes in v3 : Return EIO insted of ctx->irq_num. 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..5e46d06f 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 -EIO; + return 0; }