From patchwork Sat Nov 18 06:36:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67B4160230 for ; Sat, 18 Nov 2017 06:38:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A27D2AF14 for ; Sat, 18 Nov 2017 06:38:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F1012AF19; Sat, 18 Nov 2017 06:38:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 10C252AF16 for ; Sat, 18 Nov 2017 06:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CfDisUTwP066pnPktyaEvQMyNVZjozp9oBX670heTcU=; b=a1ltOr2X9ludIy1LjAz2Z0sS9P NML4Qd7+P1RRYw9SyUEYOMlTJP67Mt/7egbN/VCSBb1mLkLY0P5n4x+ufen12t1o64D+FWtFPzNEs bfbjzPS8wvisq9VVjJSu72XxShvcJTkDZj1eSKvB2jWg7ckx8c+Di1jPD+wf2PM3bZEglU6XoroIX 7f5Ct4WXjcwV0WLqbdhQ8XbRLxkJibyUwtU/Cc4CEwDG79UxSgyErdnTdrUnWj1+YncFvg8rkt85t NNqu7izPVH3HexpLFuhnuvgzCTnYxmrCYwiipUok0ZlrtUR2nBaGZpiaoNVWwzM4usAfsEpFtl51Y XBO0U2WQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eFwlE-0005BZ-8G; Sat, 18 Nov 2017 06:37:52 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFwkb-0004dQ-AY for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2017 06:37:14 +0000 Received: by mail-pg0-x244.google.com with SMTP id s75so3570757pgs.0 for ; Fri, 17 Nov 2017 22:36:52 -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; bh=rY0Uh5v1AecPx6/uFrwG4PNnxAk5QvgptM3m4zAKE7c=; b=CaJnVMoP55LN6Y7itNQUo4TQCKwzZ6Al/6XhZwu8ZHMiJK1FfaPAF6mypwSlwOVH8M pRcO+D2T6Y/YIbU6fHvsggVzgc1I6VjCRluhWCbali3qmH73R73SJWtb6y6KT/oMcQlO Fyrk0WMAQidHurZyH2c6RSCUZioMBfZ+sAEEJizSryscY5ojVL9b0TqVGhY0kkECicaQ Ror55fjwZX4RuD+gyNq4uQAxnTdCeP2ThlO4KoM+luNkEv5s7Q/Qr29pTeHvUzW52c/7 p0eDVBG0sCvMOyzHSolBd3yIqm0fMvsKYpK4nSsBxGBXChxoNToLff5QUvDnsDTOXTPo 2skQ== 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; bh=rY0Uh5v1AecPx6/uFrwG4PNnxAk5QvgptM3m4zAKE7c=; b=W+S72rAIdKZvnEKzchHzW4Suxgzp1EeTgs7U9Fusb5rLnS34HU6J2YNzHofOhjz7gy l5AGROR+dPcS2M0cVPZMy5T0qrp/vl9xdCrhxoNETpJ2DnKTmGTw8IMYKwFJ3JsGl+qZ RHs2ub7aGY+PYgOkAsB4s2dnoWtqxPaOmWvPKU1/2q6Trt4iQFdaF4KEP+pXgHmszEkG Ze4Jrx7RxqSjKphXr91KC0O4YxImLrZgx5cS7HyepE7yDPLRNCtGVeiDEi+uQr7GxUI6 uOYfYc0dYNmJ3QweY3CvYsjTFQtqytEhgGNyHKNpvQJgKwdXmO1L67AsfzbbXfzDEDJi IgAg== X-Gm-Message-State: AJaThX6PKhC+AH/XZxBrEI7F+Inp4VLtudCA/G/slm+g9pSKOhc1Ki1P HIVc6MD/zUIjcPkh0KYCzI0= X-Google-Smtp-Source: AGs4zMZIOmjWbm8+HAEQBBRRyDOBvfDxEP/h7l4yWQ4eUhhMRFPaRFM2zRdUYLLUCXtM0Wv5JslHtg== X-Received: by 10.159.218.72 with SMTP id x8mr7696637plv.257.1510987012311; Fri, 17 Nov 2017 22:36:52 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id d68sm9905504pfl.38.2017.11.17.22.36.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 22:36:51 -0800 (PST) From: Arvind Yadav To: lee.jones@linaro.org, maxime.ripard@free-electrons.com, wens@csie.org Subject: [PATCH 2/3] mfd: intel-lpss: Handle return value of platform_get_* Date: Sat, 18 Nov 2017 12:06:32 +0530 Message-Id: <1510986993-4936-3-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510986993-4936-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1510986993-4936-1-git-send-email-arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171117_223713_390735_F8422744 X-CRM114-Status: UNSURE ( 8.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP platform_get_irq() and platform_get_resource() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- 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);