Received: by 10.223.164.202 with SMTP id h10csp4567518wrb; Wed, 29 Nov 2017 08:19:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMa8rXwvNC1hjLpcr1LOcuKqFBt+KYdwFEUyrV1Gr1PtU0NT/qhsT/JfSorGsC4LWsL8nqz2 X-Received: by 10.98.139.14 with SMTP id j14mr3550597pfe.179.1511972399136; Wed, 29 Nov 2017 08:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511972399; cv=none; d=google.com; s=arc-20160816; b=qQKAc5E6p6kFVjZg8rxwOLHEpfl1HKLMJ3ITGsAViG371oss6NTyuGaLZKVwyRb84+ 5b8hN0HcyBxVp12xYXLtRLxrOJ2V5ZOmB5dyBR70LM1Ikne8ZEwsPpYNmpfHyhsJTcrR qtciz6Lmgn+gMhO8eSLuQcmEMciqgj8+j/lR/AZdmo58uQhK4NUXdCXxDivkkS6LGIlN qRiP/7pBgBPWpWMWY6VJLepQQYekF/n9TTxQ4p/6Fb6+Y77eKmBCTL06jVLaqpv7Szv3 NxojJn3a0gG3ujB/rP+SxQfeCx7ub2p4BFLuh0Z+2BYF9vak996cE1miUMQrXDgP0ISz Avng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=jfv4Q3I6rTBd1J7DF28R6XCtRzO2zh+6tRoK8S4cTzI=; b=bXjOZRMx9fYcFrwviRi6+DtxVAXmaTBX1dmR6U++aowfDUK7GOV6GO93O/gk2hvG4t 6brV7nV++WVPxC3CzDDLZ176mX6guD2dUJTG4JvylbCQrpEJOsux1l//8ohHIN9+QEpz 8wjKfsygnUFesapqTmfGiix/ZE4i0KFRWniXJ/oRxRBxv4itCblQu2FyKT72JfF4w8ar TuKxW0w1w0hWpPg6xeXykNzscud9573FncWl7J/UrUqsMJ6lTTuSUZAzPA/wQCqBidj7 Yk+fDsJyrzRk+rsTQzKqjU624nQ5TN8GcsPdz0jgBaauH2NB2ED9hluoBTw9DOa1710+ ElDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HtiDVFXS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15si1479676plo.488.2017.11.29.08.19.48; Wed, 29 Nov 2017 08:19:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HtiDVFXS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933409AbdK2QR6 (ORCPT + 69 others); Wed, 29 Nov 2017 11:17:58 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42617 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755583AbdK2QRy (ORCPT ); Wed, 29 Nov 2017 11:17:54 -0500 Received: by mail-pg0-f67.google.com with SMTP id e14so1694802pgr.9 for ; Wed, 29 Nov 2017 08:17:54 -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=jfv4Q3I6rTBd1J7DF28R6XCtRzO2zh+6tRoK8S4cTzI=; b=HtiDVFXSh01uSOVFh7+OpRrKITRZdAsIY3Hcu8DUeGU93Q+21VTmr2UOdMOuohqrj7 BSZqqylRfJQrdy8Gg68k9Nx4gwZxRuPA7fhbJ4wAqILGTmOjPu+7ndf25xnrytRQR11W aZvX60Bfac9NtQVL8t9iTXY0pE+tU+KSNvn4amRWY/tPd6TYwGTEvQ6/OcKm3fs5YMDf STbkxd0WAiUdsjP2GXglYuz3KF+eOm4nWnVbnppwQ88eSJAsLD0qhKoHKgDITnXo6em4 HsvC9lDUvDomzzKvKTV8+oQ3dheH1tE1IubeBbEZOQ+Bt+d1KxDavFDGt2kKIZhmjGrW xCaA== 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=jfv4Q3I6rTBd1J7DF28R6XCtRzO2zh+6tRoK8S4cTzI=; b=O3HXiOCzkbTBYib7D0U0DZdC4KOMHs9ULAvV4VmjFuKhEXNREcquAWy12HfgilSdZ0 C2IVEwffMf9sgnG6qk4vylGzg6T1e0RuPh3oi1pDtuOeNVzcDDNbwCLfap3pMREm1RPR dDpOm3TM8fs5ewKUSLbZA6RTpZpq664pBHUxGY5w8Az3AcaemCWNdoqHpsNpk0QYuy9Y wkT0wKGDSIVgff9EInB+2Li9DaUZtTpvHVzlkaOCoF2lNQvVEJ3bgmtELVFO9Lz5e0mu 7giH1MrnUNd6WM5W0jEBawlwHDTEzzY0VBl0oIbhF7dgWW6WnSuXS/gi7Jb3zUIT9cTx fbSg== X-Gm-Message-State: AJaThX5qJP91rWplvOgCeLw99XuLV0m2ev69E+yoi+RcYTBeSc6yY/pJ WWh+fDYPna/dI0EWdaG0uoM= X-Received: by 10.99.6.23 with SMTP id 23mr3271526pgg.276.1511972274383; Wed, 29 Nov 2017 08:17:54 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q74sm3867400pfd.134.2017.11.29.08.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 08:17:53 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 4/5 v4] ASoC: intel: sst: Handle return value of platform_get_irq Date: Wed, 29 Nov 2017 21:47:13 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. changes in v4 : Add separate error for irq == 0 and irq < 0. 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 0e928d5..aec7408 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 < 0 ? ctx->irq_num : -EIO; + return 0; } -- 2.7.4 From 1585981357678445070@xxx Tue Dec 05 21:34:47 +0000 2017 X-GM-THRID: 1585981357678445070 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread