Received: by 10.223.164.202 with SMTP id h10csp2383913wrb; Sat, 18 Nov 2017 20:54:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ3rqcDZinVZ8uRon01n6vwDGjS7FW4ZsMIVk+3ghvywVGpdRsO/MvxzANWOQm12LtS5/ES X-Received: by 10.159.194.138 with SMTP id y10mr10005801pln.85.1511067270709; Sat, 18 Nov 2017 20:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511067270; cv=none; d=google.com; s=arc-20160816; b=Zg3goOFFxslQxNABt+GWXyOkENXYt+wZ3Hn69p6j5Mygz0Y5kHxnx09ioyFJ6dzYJZ nBpztxwHBRiB9vQAqoq/Xxv9FoZL4hrhAUzfXoVo1KLrJp/wxHaofGsmFyhmidPEbjE6 pjfJhQDX0Uy+4JHivagiEmMR2SSsH7Zv5IhnJ1X60UlSZwFbOjyNl0PuozGLpCxp5kJN vq4huR4HJKB+fifvea37MusQE9rQRMRp5c46xsXdxG4EzEkNY8DLPwSSC7EMy4URRAYz eWAMxe2662lp72kn8g1USebmueZ6zW0CSihIjqO9NDPMNV1/9bozrY1tAQL9cKmk0wxG /qmg== 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=SHqaDbXlpj8m5Dxv4a41QHY3l6JisdvVUmBIlgDwrB4=; b=N5+48oOdMnR3uFehCoMZSdwMYVrhWuy8cvNuE9GOg5/0HogaEVd9UwyyYDE75ysi+E k+EstaXZnAszcbzOzgVN3dUUvzZLs4b4YM3LQu3NG/apreco4VFT9stDP6LnXf7YjOiS zd/NDn7WZJ3EuBwFExU+LCj/GqlrMgoiWrmNCSQmfR3LWmWAw2eOJH7KfiGVqrhHkXWc 8uGDzSqKSjYAOV4QB6LbT8gnpIUTv++y9Sqpa51xJ3L3xsVAUcuZgfy4svgQzOI0BHUl IijJIGfXwXewZke4RnR3ODrltDq54C25aEM++KkG3hu8LYimgO4t5oabJRcEZKhwl6Ts tvEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VFOAmKsM; 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 a12si5619986pls.398.2017.11.18.20.54.20; Sat, 18 Nov 2017 20:54:30 -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=VFOAmKsM; 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 S1751097AbdKSExa (ORCPT + 75 others); Sat, 18 Nov 2017 23:53:30 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:39499 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdKSExR (ORCPT ); Sat, 18 Nov 2017 23:53:17 -0500 Received: by mail-pg0-f67.google.com with SMTP id 70so4876602pgf.6; Sat, 18 Nov 2017 20:53:17 -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=SHqaDbXlpj8m5Dxv4a41QHY3l6JisdvVUmBIlgDwrB4=; b=VFOAmKsMhj9HKcfa0dSKExlOtveBO3wd8k/AQrYEu05bh7Ittk3IuqCjF9agc8RLFk G/n2PBYgob0nxEHOL6zkJzim7LBjbxV5kSp00vz6Z8jjfwJSKGKiqffMQtPLBQSQ120B fmwyNE5Z/7cKRFOHtgapAEenTfy0kEXo7PWpL9CUZRcJS6YRtYi1VMvLvCVry4GoXaCE 001JUCzK1LEV9w6HQxl6H3S7JEkdm680PT5jyfBRgLV2eP3Oliyp1om6Dt6vFwu6YWIR S1bB6Xi5Mra4cyH+PEIs1pkOqOPnlT2LykuWrvP665sbLAlLZdwlslFaQNtCGJkTXnv7 LoBw== 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=SHqaDbXlpj8m5Dxv4a41QHY3l6JisdvVUmBIlgDwrB4=; b=W3/7nRg14EQ+XW7aTM154yMRwbeiMUbvkk5mwZmJGuaJERK0Pu1xD9M3nAox75UAPF THWUwGNGJK8thAo3bYHohiZaVb19H1mpIYoBGFOD9TKhR2s1/OL4QzbbpgBd1N8eBT8Z A59OeIoYtzZhzOQSXVbsMSUQXR7glgpqT4eBFNCKQt09Cc0QE9+9p9FF6zQxmDH4DF9b /Y63OgZei5TtbdJ6v/nCXPakHYvEjEnWHGPn+NR293TPXDToSf1o1TX7OVGCy/tWGcTV c5RadsP9iAAfKwxkbGwjhEogFqLS6mTfjRdfjrP+jBRhgkl6jN53y9OUqbjBKa78lEdk 4n/w== X-Gm-Message-State: AJaThX6svu7gaMIFzjBvrX5qInSzYOVax1o3l4fOcEyLWhDQ7zLF0F6B 5WPKezp5P6EphFoBiTAzrZ8= X-Received: by 10.84.209.136 with SMTP id y8mr9997466plh.439.1511067197249; Sat, 18 Nov 2017 20:53:17 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id j79sm2312952pfe.129.2017.11.18.20.53.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:53:16 -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 6/6 v3] mmc: sunxi-mmc: Handle return value of platform_get_irq Date: Sun, 19 Nov 2017 10:22:47 +0530 Message-Id: <6ad5c6077b96353a77ea30d1b64651c77d5622f6.1511066652.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: 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 -EINVAL instead of host->irq. drivers/mmc/host/sunxi-mmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index cc98355d..c926ac8 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, goto error_assert_reset; host->irq = platform_get_irq(pdev, 0); + if (host->irq <= 0) { + ret = -EINVAL; + goto error_assert_reset; + } + return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq, sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host); -- 2.7.4 From 1584464604987286167@xxx Sun Nov 19 03:46:39 +0000 2017 X-GM-THRID: 1583913185349379817 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread