Received: by 10.223.164.202 with SMTP id h10csp2349954wrb; Sat, 18 Nov 2017 19:56:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMb3O2yt+Ecc9TuJl/cCIMvInPBg6VcLf6JrWT8U6x9sBn085YN8FJUYiALasOCs69k95FXh X-Received: by 10.84.192.131 with SMTP id c3mr10060999pld.435.1511063813241; Sat, 18 Nov 2017 19:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063813; cv=none; d=google.com; s=arc-20160816; b=Yr4YhBZqA+D7EWedfi9uyXEa1DEJsA9glDB9plbPS4sdsd01sGyeGPBgsEmuOMVN1l Res0bi5tW1u8LLWvSLint2nyzGNno0R/mvOiFiIVErMrMgYvRRQjEZHS8GAYLt+FqNNm N921B2bJLM7xBidoqT3Y9KoiqjTHbTwkidxOoSwntoSlo3LkZJ/SA2GaQKTKvLea6Hch DvQG6vOhlNyzPKGlhzZ6i9nn+4AmlyWatTClbiMH6SkwRz2F4qC2fjpix4Gslwm60Cj4 wb3rKD0GvdTIFG/3l9SJn2FE5E2OnYTDZ9jaDjxNU+gD/wf5Sijbd/10WiRlUB7yqxIp Dq7Q== 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=BdyLi9FjKAcopuKRh9sSVffYvZNgeLxHTIjfX+hJpUg=; b=OsawMCwkKU/8d/g0QKnHVS1BkZK98crR/LZlYfkv0m1o5C4t2s98g0+LIFg9GxxcaL 1mUiwTl/aXtipsyOcMfklXcyyAMNgS/tK1cqN3iQAK2rVFbta2bFMO5X7FzP9KHx3ZEX o/JEyMZAkI4ZN6ndXgu6Y/Dmv0BqFyla1sF/Cn3HI67cF8L267ejV+bTcr6OPrneNcwM klQKqjrEFauHG+xlpbVfaL4/RCDjjlBADeYr8Bvb9maeEMvZ7Q+jRydQObxALQpXHorK W/q7nFneHUUBFuKYPURy0pI21TDZUv3eGdrNEXPdDfWbJA9cE3BC0TA8KJypwykpByFB zLcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qW3mUncK; 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 n1si5414561pge.496.2017.11.18.19.56.40; Sat, 18 Nov 2017 19:56:53 -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=qW3mUncK; 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 S937713AbdKRJg2 (ORCPT + 93 others); Sat, 18 Nov 2017 04:36:28 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35942 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163261AbdKRJeb (ORCPT ); Sat, 18 Nov 2017 04:34:31 -0500 Received: by mail-pg0-f67.google.com with SMTP id t10so3758098pgo.3; Sat, 18 Nov 2017 01:34:31 -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=BdyLi9FjKAcopuKRh9sSVffYvZNgeLxHTIjfX+hJpUg=; b=qW3mUncKV4+SOZJvrjLWNX2PKO1jvUtxsLlnrcqNo5LLKlrvra5nqeJw7vwBfuFm7O RvlTX8oINnRdg4HaWdM+60seqnCxIzS9frW6sduwalNYKpv6Mbp+p9DXfXWeZl/Tp1f/ W3VCc/HfbvN0SkRMwz14VdeNNLW8duwKc3qC3K//0pBrUuB5B1W6DEoZA+Qwtnaqv2ZB WnNV/T7Jw7+xDOo35K3R+fESpfp38tvFNfNgrLl6KLChK1oMsnpw5o+NmmOmbcY2xOyN l8oUWx7lTpn1eMUP47LTKX2bfaCbOfiiCDwCPHz0FJ7D82rQlUV83ukvuQQKA8Dwg74/ 46iA== 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=BdyLi9FjKAcopuKRh9sSVffYvZNgeLxHTIjfX+hJpUg=; b=iQukgWg5dZcMHbXwHiHRHcKIH7yWfUEunbdbK4fgaphqxiSd92lH2Qjp4g83KUaPNv S8rKX2SLYQz1WGMblB89bqIc2tvBvhpVXKPYN4/5hfw7gJ7MYSBkvjI60u5Ua7kJD1RO AbxyWL/G4JRJXWn4FJvsA4vW4ff+P2eM3WqLVlpdyohtkqPePYjaKOs9KgmhBjD8DwoJ j0/UCHG1NhaG0YPgRqurK2HQeOQ7fSyMoROYPug4YTXCQOrwqObZRIzDaAfFr3DfSBW1 35KJddO6uriQDWSLxMk8jFG4FHZ7WjV9d6biniPNsQD04pr7YtjLnEasFtKs5FL27pgl NSqQ== X-Gm-Message-State: AJaThX5E9hCvNPxSmg4QAqlorpNYCt392v06vhSVCeKBXzExzoqo0njE /ljINvuFw2GOEvOS7hByBHA= X-Received: by 10.159.205.132 with SMTP id v4mr8078886plo.426.1510997670476; Sat, 18 Nov 2017 01:34:30 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id y20sm11057079pgc.52.2017.11.18.01.34.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:34:29 -0800 (PST) From: Arvind Yadav To: ben-linux@fluff.org, ulf.hansson@linaro.org, adrian.hunter@intel.com, vireshk@kernel.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, carlo@caione.org, khilman@baylibre.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 5/6 v2] mmc: sh_mmcif: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 15:03:47 +0530 Message-Id: <59e155d8c3eff4adf39cd343c56e52530020f64d.1510997223.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> References: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> In-Reply-To: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> References: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.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. drivers/mmc/host/sh_mmcif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 53fb18b..481f2c4 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1405,7 +1405,7 @@ static int sh_mmcif_probe(struct platform_device *pdev) irq[0] = platform_get_irq(pdev, 0); irq[1] = platform_get_irq(pdev, 1); - if (irq[0] < 0) { + if (irq[0] <= 0 || irq[1] <= 0) { dev_err(dev, "Get irq error\n"); return -ENXIO; } -- 2.7.4 From 1584431394656818729@xxx Sat Nov 18 18:58:47 +0000 2017 X-GM-THRID: 1584431394656818729 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread