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: 714208 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4811C19F4F for ; Wed, 16 Aug 2023 20:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345523AbjHPUE0 (ORCPT ); Wed, 16 Aug 2023 16:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237492AbjHPUEY (ORCPT ); Wed, 16 Aug 2023 16:04:24 -0400 Received: from mx4.sionneau.net (mx4.sionneau.net [51.15.250.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A19E55; Wed, 16 Aug 2023 13:04:21 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.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(-) Acked-by: Oleksij Rempel