[PATCH] mtd: rawnand: lpc32xx_slc: fix GPIO descriptor leak on probe error and remove

Miquel Raynal miquel.raynal at bootlin.com
Tue Oct 28 08:59:26 PDT 2025


On Tue, 28 Oct 2025 17:47:47 +0800, Haotian Zhang wrote:
> The driver calls gpiod_get_optional() in the probe function but
> never calls gpiod_put() in the remove function or in the probe
> error path. This leads to a GPIO descriptor resource leak.
> The lpc32xx_mlc.c driver in the same directory handles this
> correctly by calling gpiod_put() on both paths.
> 
> Add gpiod_put() in the remove function and in the probe error path
> to fix the resource leak.
> 
> [...]

Applied to nand/next, thanks!

[1/1] mtd: rawnand: lpc32xx_slc: fix GPIO descriptor leak on probe error and remove
      commit: 3ae23f77b6a0cd53b557ac69c98312f7be22f081

Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl




More information about the linux-mtd mailing list