Received: by 10.223.164.202 with SMTP id h10csp2348286wrb; Sat, 18 Nov 2017 19:53:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMZx0/ZmE5kUmCvkX88pP+sY+my0VRrZwgqCJ3bexwgQdkt05IimgRKQiayhkEJ+ILaEGvnx X-Received: by 10.98.44.2 with SMTP id s2mr6972529pfs.175.1511063637451; Sat, 18 Nov 2017 19:53:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063637; cv=none; d=google.com; s=arc-20160816; b=apZnbVMq4PKWziij7cpLWwhrLcxsSFi9Z1W/6pCRG+q7VHeXqO73OugvffhBfjsKOQ sd1rvOdFzmQdbmJJrnhq42nGIj2pLB71lkYtlEHoW35NL9ddrMf9SwSfGjYgKX/aogaS t2n4miHPhc+i583ZCeYvvSCtJ53TIrj7vQIy28csihKqO20lzhSC/uy0RYcKPwFZMxYh P4eaGeTGYxvj5org6BaG/ETdDlpiD5TUQWOTIk5X7qXRvq6IWRYhKbWzLwjoo2Cqcvuv KeBnGUXN0uQmmw5s8ybcZGcaRWpxaSIsUcAOtsl6GqPZnU/ls9k2Sj+z0h/mGdYSzcvb CcJw== 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=ACvuZp6sdl84EC2sfvlQzz5OIbXPZ3MXzOf6LxfHpB0=; b=HJr+bMLYsdVuah1ZYvEjWHtq/dacTmA4pQDigMSRTOxFmAXGu3O/LabpiQe3N9eEuF aGGY7aEO0gvqlCvbLvrP7x5zvFa0nAjbA+9rXFlN+mTtj0XPTb6pNjjWiX4ppiY8MaQf KYz/66Hv5Gs8pyzkZXMeoKQNbp494JmL8s97QqFEMKQerHUm8lX6iuwkEveRQ9++fHZ+ k+GHLLXPaxtXecC2wk5Hi461GG5VpkyGE9F3LaJF25ISJlBwv9YOR3kySZn6WUWAqWLl 61uC85nLhRpZebV7xfcg1V6T6qmdqp4gzzgrEgl9nX9k0L8KT4/QonIbhufdoIIfGkIC /Maw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OTx0RHkr; 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 b14si5555629pll.465.2017.11.18.19.53.44; Sat, 18 Nov 2017 19:53:57 -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=OTx0RHkr; 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 S1947099AbdKRIvQ (ORCPT + 93 others); Sat, 18 Nov 2017 03:51:16 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:43009 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1947078AbdKRIvE (ORCPT ); Sat, 18 Nov 2017 03:51:04 -0500 Received: by mail-pg0-f65.google.com with SMTP id r12so3696458pgu.10 for ; Sat, 18 Nov 2017 00:51:04 -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=ACvuZp6sdl84EC2sfvlQzz5OIbXPZ3MXzOf6LxfHpB0=; b=OTx0RHkrDUJgZK4etl4KNnIWTuBMb5S6SpWbbvUEG7M/cAG4xkPEzgjLrWWkCdJFNE oU5q2ZMnfVVqzwgrAPvD/+F05KO7jIqhjRFUzxkuAPluvt67vDdoMkmDYtR6nNw8+g1R ZUotOk8zoGBpT4H5118mjClrRA4NF3qnlB4fyC7HmfucOKrPMdiY+LisG27YyKU0sm9m j/juvya+HQOpmRAEvxgNBs8BsyAY5/c2Ckw8J/1KpQyzRy6FdJW0dyt2XFBPDOEf1mQF VDQNy2QAGCyO3qZlyYipnlmPGLA2IdiWFhX1PrLugQXzjv+bc9EE1KS1gFt/utlws9/j F6rg== 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=ACvuZp6sdl84EC2sfvlQzz5OIbXPZ3MXzOf6LxfHpB0=; b=MS6ILMvn4bKvFMoZPbn21D7eHF25almU7+I5YSn+76mrp3cY3GMqZqNACUgrtI3vjT 17hHNYJ0zA76kKZ4wAolrEYmJfw2BKQxFjEI+jKjyTzoqYt92ehDHKByXb4ReE2f7SEq t55rmVn3V7At5g9sF8zvaqT9QeMO4PALRQnChdmlakFYVs6cEsCVxuY001jjOTE2SqnZ 8kuskxxNWOGBRdHQLWpjwBgymonIlSwvvepCPfMBBxI1OgAQUeD5BJ8/aR1kFb6X2Otz pGb2WbEuZQBBoxj9T3f3tEIncAzVWGdSLtJI5Vb9+EYSGblpnT8ooSenHRO0mzXXhuMn sacA== X-Gm-Message-State: AJaThX6AjxUZDnpnn9tH2pY0u7HIp4NzaR2KdECRVtnDjGNp2S0yfTE6 PqMe03vai6Y6/YM3zJ307OA= X-Received: by 10.101.74.8 with SMTP id s8mr7503706pgq.259.1510995063780; Sat, 18 Nov 2017 00:51:03 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id 3sm11847104pfo.17.2017.11.18.00.51.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 00:51:03 -0800 (PST) From: Arvind Yadav To: lee.jones@linaro.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3 v2] mfd: intel-lpss: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 14:20:48 +0530 Message-Id: <4123c03394df1d0a1349a9eeebf74fcf760c79d5.1510994295.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> References: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> In-Reply-To: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> References: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.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'. If IRQ0 is not valid. drivers/mfd/intel-lpss-acpi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index 7911b0a..cb84de5 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -92,6 +92,8 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev) info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); info->irq = platform_get_irq(pdev, 0); + if (!info->mem || info->irq <= 0) + return -ENOMEM; pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); -- 2.7.4 From 1584667196105407099@xxx Tue Nov 21 09:26:44 +0000 2017 X-GM-THRID: 1584667196105407099 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread