From patchwork Wed Aug 16 20:04:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Sionneau X-Patchwork-Id: 13355628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82667C25B73 for ; Wed, 16 Aug 2023 20:11:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RvUmWlK+3ZvXXNrnwwOxRVuPn4XyQbMpvTHtkPggEck=; b=pjAnACvgTF0qfe 6JkRS8V6dfM7ajIXBwqK40B4Jl5oq8LOWS1UNM+A7EdeHMX600uIR88xTx6PRikAFrOmh++VK63QS kQ+lL8reR2pRDLI+J/5TLE1E0Jwhk7/fLHZycGwSJeHB5vMyU+0auwJSyrFfp+aGsnwnR7vM73Orb YCzNIZ3Hozvdu6Ukrsz4ilvrSJ46RLb6LiE+dY7S8k0n/7PeIhCIny/OzgxYG1IpIafS71rcinAfs IeDxSeBm/sNCV8Q11Hxca0/3UMr5WBYmUiDt5QcDElcdNP8ANenOklR9BquzoDNqn2LZMJzANWyYW 0Mf9GW71Ldama1zqr4QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWMr9-004vra-2Q; Wed, 16 Aug 2023 20:11:03 +0000 Received: from mx4.sionneau.net ([51.15.250.1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWMr6-004vqn-1J for linux-arm-kernel@lists.infradead.org; Wed, 16 Aug 2023 20:11:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sionneau.net; s=selectormx4; t=1692216259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0QjcSWERrvlydgwZfM2ctqBNZ+6TXFZnAAhKEjv9P6M=; b=HPFxFrFagO06p3gelWZM5mfgZdRRAZNqK2YFuIlYqBYx43p1pz18GDu+ruxmbs1Eg22Y3o N142k6tRNMsMHqc6cjE+ECwUQL2vv9GBsvA95BmPe/n0RMvD+rwEucmKWj2p2sNix2hU5h JAsmw/RmnMYls0OzDliWE4i9rDdjZ50= Received: from fallen-ThinkPad-X260.hotspot.hub-one.net ( [37.169.176.143]) by mx4.sionneau.net (OpenSMTPD) with ESMTPSA id d6809c2a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Aug 2023 20:04:18 +0000 (UTC) From: Yann Sionneau To: Andi Shyti , Codrin Ciubotariu , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Michal Simek , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Yann Sionneau Subject: [PATCH 0/4] i2c: devm_pinctrl_get() usage fixes Date: Wed, 16 Aug 2023 22:04:06 +0200 Message-Id: <20230816200410.62131-1-yann@sionneau.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230816_131101_012245_570FBA6F X-CRM114-Status: GOOD ( 10.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Most of the patches just remove the check for NULL for devm_pinctrl_get() return value since it cannot return NULL. One patch also sets back rinfo->pinctrl to NULL when devm_pinctrl_get() returns an error instead of a valid pointer and the driver does not bail out. This last change prevents core i2c code to dereference invalid pointer because it checks for rinfo->pinctrl validity with "if (rinfo->pinctrl)" before dereferencing it. Yann Sionneau (4): i2c: mv64xxx: devm_pinctrl_get() cannot return NULL i2c: at91-master: devm_pinctrl_get() cannot return NULL i2c: i2c-cadence: Reset pinctrl to NULL in case devm_pinctrl_get() fails i2c: imx: devm_pinctrl_get() cannot return NULL drivers/i2c/busses/i2c-at91-master.c | 2 +- drivers/i2c/busses/i2c-cadence.c | 1 + drivers/i2c/busses/i2c-imx.c | 2 +- drivers/i2c/busses/i2c-mv64xxx.c | 2 -- 4 files changed, 3 insertions(+), 4 deletions(-)