Received: by 10.223.164.202 with SMTP id h10csp2324312wrb; Sat, 18 Nov 2017 19:13:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ+3lW3iQBtfHvZaeRBFpg2CSUhAxFjIXbs2dXmXcAM4DqtRA4jGEm1aaw799Cy+/9OMiyT X-Received: by 10.98.247.26 with SMTP id h26mr6832952pfi.233.1511061190612; Sat, 18 Nov 2017 19:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511061190; cv=none; d=google.com; s=arc-20160816; b=pcyOSrtYtwYcggEPgcaRqZALkeBu7C6aC6DrIE3tG8MyBIlGtlKlk4UYgssLL7/2eL /zntfFteU3kq/OQILOwvM99npNII2Pa+8+8/OOm4bFVA9Z/nQu+8DdboQKlrae8s8kn3 jBf2CrkKP3BPP/RsKmJ47r4EUfVL3Nly85m9VMdkZa86aWQYHsu0G1i3JmXRIKee4wrg /ezyu5ks01dxiQqR/aXUStNRhPCEuORWHbKVfgRg/UO6qJe+hMF2B2KnwvgdMfHeIszX 1DKbyp9XavgWSj4C+OElNLQ27BwKVPd9/8xqGD0Rw96RGtcUlrtFMK2pvZo25MqvM7Na uNJg== 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:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=rY0Uh5v1AecPx6/uFrwG4PNnxAk5QvgptM3m4zAKE7c=; b=ZLLNwOR4omM8iwbOKpFMQ+SzFejDBFzIE8LX0uiyTPCBJrOtI9wo1J4oeVsct5+D00 jhwuVscWtCWaftIdFqQkU/i0zMPEa/3aRXaWjQ+uaCBgIDhx7zipc4QXaeNwRUGJBJ1f AL2NB8ftrQldrOIqqXUACWbiUITutMcd72BuR1Uj+png66phcGG5lt+QgwpM6ly5H9mP HtoT0Mml8GgIB3WVM8K2QmtjvGl7o/GoleCGoy1Fzro1YsiP3Kl5TrXCO+7ehTk+QmuF W7iCYOs12lZup3KmPA9s1guEr2c/i9SlpJ4uL1TvzYnRfTlhfElqKKg+jwACpGrehV3E PZnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CaJnVMoP; 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 w9si5402578pgm.49.2017.11.18.19.12.46; Sat, 18 Nov 2017 19:13:10 -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=CaJnVMoP; 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 S1162812AbdKRGhN (ORCPT + 93 others); Sat, 18 Nov 2017 01:37:13 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:41923 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162777AbdKRGgw (ORCPT ); Sat, 18 Nov 2017 01:36:52 -0500 Received: by mail-pg0-f68.google.com with SMTP id p9so3552538pgc.8 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=WRA4dpvQidnWqmT5JWV3sxX7e0K84QrX0y7xPrj7vgiFTmLtCcJhNGX9pEPMWzP1US uk94QCDa/AvPGY3L7WhMqUiq0zGIPR6VZkvwS6ilpCIRQb4j95VOVab6gbLi2bcWochf FbwYuCc8ow6QjmuUiJz3V346QKWKuXIcWOvGMCWsH3zY8YZVQNmf79tGg4rZH/HGFN37 HNXvalQmX/LV7x82crqfA/DltFzckyxdys8yWNou90TpUjGawBEn8mcfj9NMP0yx4ng7 IGrv3jFsObsZKLI+CwFIglaWdFvBYolvwrcfy0JSiC6Na3i3MI9swFAgXv9jQu4mBOMm 4/kw== X-Gm-Message-State: AJaThX7uSz93LU8VFSZ6e2M4Kdr6CoHbm2Tdt1Eu5haoCnIErUYXI8UO jZKEg4s/jRDD4ifHvBmVK3g= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4 From 1585610868511656573@xxx Fri Dec 01 19:26:01 +0000 2017 X-GM-THRID: 1585610868511656573 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread