From patchwork Tue Jan 16 22:48:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 124767 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1174894lje; Tue, 16 Jan 2018 14:51:02 -0800 (PST) X-Google-Smtp-Source: ACJfBotRWD82OBw0pZ3uEPLuVqYhjb+Fmu96oGP6NT4MnHnL6BZTZ8sJLx+I3cofxPMmgehVunGJ X-Received: by 10.84.168.226 with SMTP id f89mr17866056plb.110.1516143062245; Tue, 16 Jan 2018 14:51:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516143062; cv=none; d=google.com; s=arc-20160816; b=u2UF77NmGIkOOf+M+UpynwqQgcj8K6fr4a3MESEzj31GAbr03aXhcOf+tbw7ZPWc9+ ZZHFTOj6N7WO+2slsoJBGqVA442SJy7Vu40K/StRvRVzIBiA71s4s6xNxZbe5QYtYHst ESdwp75rCD3ulUb8aAJhceORQkbIsjrFIrfkGcqq/sDrrpmwEYWDKzCL9ON3odIt1XzA ElDn8ad6t9uq3AbfQokbsz5j0C4JqQZOzUn+cMfZ6JAYkcHY+Ro1nHaKBsb5vfSEyZO3 k+m5EVC4vnR3wyBiOF22Q0/mEOVEO7fwTFBIHR3ZTENcicKfgNfBtpWw8FR3n4DmtuDt j28w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=XiK1Vt9zFuXtRucfgjA3Zmp209yhLf0o8RqqclXyP40=; b=sGegRVfQaW+aiNVsW3HIMH41HI1CQiN0o3jZawrIDvxV9baaHNnwbwysfsqAMOpJ+j CgCiQwsxHaEGQOyB7qmcFh8C9i6tx02HGkG1Y7roq55qXrV4EPfz3NUBB9EuZLceHkFv L8vZj4Jw3+Pf9QdnhTjoe3YU2hqVzcrHZzQkroebMtyJcogCUEVYvnieo6wEwmSWfiOH zq/gZzAGAE+X8UN37Elfx7lTLJqr8fREHKsT6zNqb1+pOgryWHE9GHjHGG+KdyjxAfeH 8FgT3W4AjASnTalMLATPHuYC1jB54nSAK6c06e4Lyq21ZLjsnPuruWMTt59Q2ht0Kbe/ x7Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cbUCuujE; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33si2772337plb.588.2018.01.16.14.51.02; Tue, 16 Jan 2018 14:51:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cbUCuujE; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751117AbeAPWvB (ORCPT + 6 others); Tue, 16 Jan 2018 17:51:01 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:42008 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbeAPWvB (ORCPT ); Tue, 16 Jan 2018 17:51:01 -0500 Received: by mail-lf0-f67.google.com with SMTP id q17so9257273lfa.9 for ; Tue, 16 Jan 2018 14:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=1Fj7kHTSQzrhw4IDoXQpVUlpAGsF686Z3yrHQPbXriQ=; b=cbUCuujESyYyxiNbRxqM6db03uOk1btrv9LoYlqLKdDN09Db7b2RGPPaGi+4qsVKVb MeWaM/F0gSDrvmDbnIr8Gdj2czB5ZzjoktSld695DrpPu89D0iplsam3O+k0YV8DpXen W7EoRC8CB9MTAAaUlgVw1Xr78m1mFpxTZRb0A= 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; bh=1Fj7kHTSQzrhw4IDoXQpVUlpAGsF686Z3yrHQPbXriQ=; b=lcSIXFWUcYe7xVXmeJ5tfyFe+zpR4VN+ckR4twZLGnOMnhk8t34eJZC3ildAlDsNvo F9XuGvruV7tVmubyXFV1xaZxo1V7WZxlkn8JLF9YNWtWO2yE2tc6gqP/qVdxDS9uJut6 /lSnjNqah1qTCCDSLmQI8ltcXnM2WXeA8sO2AheOTeTVTIMJfnXQTpXvL1yvhFqBGiKY 6Ovta/VeLqBMtQIMmXXe8okNojtnR21ODZ967C5BmLMOpqxMFxvkIe8el+qm/gNzXx/7 VuDIRBspwrni9eWxOgWbGhu6zNqiY2P1lvc6xB96TfxnxeOda2z0NT3vOkmtN1fbh1Gg LqTA== X-Gm-Message-State: AKwxytfZeRaKKwuRI4bb9ncYtWP6ZnCoSbOPKJKGrL6CtSCYRn4uJBYt UVALbnXaqgeng28sS9xbd3fJcmj4stA= X-Received: by 10.25.199.208 with SMTP id x199mr8948560lff.77.1516143059364; Tue, 16 Jan 2018 14:50:59 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id x7sm589950ljc.9.2018.01.16.14.50.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jan 2018 14:50:58 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Clemens Gruber , Lukas Wunner Cc: Linus Walleij , Heiner Kallweit Subject: [PATCH] gpio: of: Fix NPE from OF flags Date: Tue, 16 Jan 2018 23:48:54 +0100 Message-Id: <20180116224854.22470-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Some calls to of_get_named_gpio() calls sets the flags argument to NULL because they are not interested in the flags. This caused a null pointer exception since we were unconditionally using these flags. Fix it. Fixes: 6a537d48461d ("gpio: of: Support regulator nonstandard GPIO properties") Cc: Heiner Kallweit Reported-by: Heiner Kallweit Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib-of.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 71ba008b7f46..27e8a339310c 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -129,7 +129,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, if (IS_ERR(desc)) goto out; - of_gpio_flags_quirks(np, flags); + if (flags) + of_gpio_flags_quirks(np, flags); pr_debug("%s: parsed '%s' property of node '%pOF[%d]' - status (%d)\n", __func__, propname, np, index,