Received: by 10.223.164.202 with SMTP id h10csp2384540wrb; Sat, 18 Nov 2017 20:55:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMY3UN1ZFmSL1VkH6iTmQKTRxJ+xz/TwjbPZX5rYUuBjVvHmNB66QAm9jhGEIsD2k0czb3mv X-Received: by 10.99.51.205 with SMTP id z196mr9829001pgz.374.1511067326684; Sat, 18 Nov 2017 20:55:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511067326; cv=none; d=google.com; s=arc-20160816; b=oBH8VDjly256SdJ28djYYo63JmvgyVVVCZgWMOHVPYjCAOrZPzI7gAeImjAPUgmB22 qVieRas65AznkRj3tXFbKq5HE/oGtmGN8+aUpooxIkOUtcZRUHWSZi+p+VCc6sZBl+d3 xByF6b98Yrohh80qa1ItI7ewEoZAowSkcJTDxPXYk+0W9vdvYgqdW7HNMS0MOB54UlCR KF2coyvrt5uMsbOmvsw/71pPbWQIiK7HzX7o4xoFR1vICfqFtg2Fy7cIj/CjNRbkqM/X PmKfKMRulQBJTAvo9e5i//WSnXQoRu8DPhpAzicN+y0gbXXsPvX3Noz5eqg+zDzxAEMp t+tA== 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=/DdhMJIHA7dPYkpTFB+tvRROKNKbmpHkIqW2MLFcS18=; b=E9cNpmZ1gb2tLpcJBjT71YcIByIO4r0jmgw7+uau+JwDy44YMsxNN2o7Y2+/njIcjn 0WcNsHWgrqdubIIi1okRsxkaCmPlBXBEYxwN3zCEx4VCy03a+1W61fn8AVxl5ef25D7u WNypScBxwvSY97hqEpbrVKf6w/53wC9Iix4vCgwEj0iJ9ne4HH65g6sUTArMed2T7iga uLmcZd/l5ocyBjL54Lij+z1x9NQWQ9Aucq2MLXomnRDKok4F2qZKy8i5As3pFsswmaCq C6TyGcCvunmna7UdcMlp0Llw08Dd0dFwZ93sy/bMefJK9pWaYFAmMLR2YuitNuF4FFtS rVgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hkd5vgpL; 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 j8si5476478plk.775.2017.11.18.20.55.15; Sat, 18 Nov 2017 20:55:26 -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=Hkd5vgpL; 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 S1751020AbdKSExU (ORCPT + 75 others); Sat, 18 Nov 2017 23:53:20 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:45536 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbdKSExJ (ORCPT ); Sat, 18 Nov 2017 23:53:09 -0500 Received: by mail-pg0-f66.google.com with SMTP id 207so4864069pgc.12; Sat, 18 Nov 2017 20:53:08 -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=/DdhMJIHA7dPYkpTFB+tvRROKNKbmpHkIqW2MLFcS18=; b=Hkd5vgpLks2KfqRt0s3xP7ZOebu4rS2uq7zrcXMTkFc0gaDAROy6Raal9WSoHVDSQ/ ravKJ1BRZiYsLHYucj5fPQz7iSeitXfh7R8OayxoEpKMo7raHpp5MjAcos60YXVywrM6 nbM2mgMK0vo1oisWqOM5U+JLJUgja9edtggTW2N8BMYRPu9s3drESCl9NXPe38EMQt60 gvCbW73mkolazNa+XcS1OuHaC3/1nm7pcv+xGnAGygJ30outSBZW1zcaTPq5Cmun213v pS64QJ3OjBOpl3M0yOFkmQpeWaQOBHcnFTO6DHu1OO2Oj3E5YeHUPbSO+CZve6ZTcF4g f6Tg== 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=/DdhMJIHA7dPYkpTFB+tvRROKNKbmpHkIqW2MLFcS18=; b=ewkLYVPyrFwvYYbXU8gUEPNCcOu9Owl8ADRkwjvnX4+mzhUp36k/cX5Okp1smISTUE UEss50PUxIEEisa3U0fheorHVdjPrsB3cV+w2NPowbOaKoqv6Afywg9KDQ1UhzAv8r77 /4Sd8KC/LMh3cDLPUhg4cOvT/e1uSkZn8REdvIW0YJGn+ttUDKSDAV674r0jU1mOwvvH ccRW4cAgm5OHc9vIE0yXh1z+kaA0NGJ12uE9xGWBwmI8nlfytxydy8o8cNXgwbYquhkT 18x/bbg9eYrYfU0tDYwszucdZl+gOSZ6Z4N5PgSJ0v76PpWpbOR3qHXKQWdO75kiO/ni cb9w== X-Gm-Message-State: AJaThX4KqfHC+0Q0Dv32lTXZsRxMRRELf9HK7BfUaxfdyPikVFLT9qus bxS16bma5BMhGFaS89HmV4w= X-Received: by 10.98.89.220 with SMTP id k89mr7182670pfj.36.1511067188563; Sat, 18 Nov 2017 20:53:08 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id j79sm2312952pfe.129.2017.11.18.20.53.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:53:07 -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 3/6 v3] mmc: sdhci-acpi: Handle return value of platform_get_irq Date: Sun, 19 Nov 2017 10:22:45 +0530 Message-Id: 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/sdhci-acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index b988997..0d9965b 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -566,6 +566,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev) host->hw_name = "ACPI"; host->ops = &sdhci_acpi_ops_dflt; host->irq = platform_get_irq(pdev, 0); + if (host->irq <= 0) { + err = -EINVAL; + goto err_free; + } host->ioaddr = devm_ioremap_nocache(dev, iomem->start, resource_size(iomem)); -- 2.7.4 From 1584734410368838072@xxx Wed Nov 22 03:15:05 +0000 2017 X-GM-THRID: 1583483337964688427 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread