linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] i2c: devm_pinctrl_get() usage fixes
@ 2023-08-16 20:04 Yann Sionneau
  2023-08-16 20:04 ` [PATCH 1/4] i2c: mv64xxx: devm_pinctrl_get() cannot return NULL Yann Sionneau
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Yann Sionneau @ 2023-08-16 20:04 UTC (permalink / raw)
  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, linux-kernel, linux-arm-kernel, Yann Sionneau

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(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-05 10:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-16 20:04 [PATCH 0/4] i2c: devm_pinctrl_get() usage fixes Yann Sionneau
2023-08-16 20:04 ` [PATCH 1/4] i2c: mv64xxx: devm_pinctrl_get() cannot return NULL Yann Sionneau
2023-08-25 21:11   ` Wolfram Sang
2023-08-16 20:04 ` [PATCH 2/4] i2c: at91-master: " Yann Sionneau
2023-09-05 10:42   ` Hari.PrasathGE
2023-08-16 20:04 ` [PATCH 3/4] i2c: i2c-cadence: Reset pinctrl to NULL in case devm_pinctrl_get() fails Yann Sionneau
2023-08-16 20:04 ` [PATCH 4/4] i2c: imx: devm_pinctrl_get() cannot return NULL Yann Sionneau
2023-08-17  4:46   ` Oleksij Rempel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).