[PATCH] arm64: a37xx: pinctrl: fix info->dev used but never set
Stefan Roese
stefan.roese at mailbox.org
Fri Jun 26 10:29:09 CEST 2026
On 6/25/26 11:45, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz at cherry.de>
>
> A bunch of code calls info->dev, mostly dev_* messages and devm_kzalloc.
>
> The former can be passed a NULL device and _dev_printk handles this just
> fine.
> The latter ignores the dev argument whenever !CONFIG_IS_ENABLED(DEVRES)
> which was true in most cases until we made CONFIG_DEVRES mandatory for
> U-Boot proper in commit 217cf656e249 ("dm: core: Default to using DEVRES
> outside of xPL"). Failing to set info->dev before it's used by
> devm_kzalloc results in crashes, therefore let's set info->dev before it
> can be used.
>
> Reported-by: Ben Schneider <ben at bens.haus>
> Closes: https://lore.kernel.org/u-boot/IRefanijM8fTzOXeGe-H5hmhRkm7pt4Q83BV6VcWKlWp0s4i8mYcONTQz-IVhvNWlGta4LtnfK7ti6gxlrqq8h8cotgG1S0Fs6_DviAHvyo=@bens.haus/
> Fixes: 0871806629b5 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx")
> Fixes: 217cf656e249 ("dm: core: Default to using DEVRES outside of xPL")
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
Reviewed-by: Stefan Roese <stefan.roese at mailbox.org>
Thanks,
Stefan
> ---
> This was apparently tested by Ben[1] but it'd be nice if you could test
> again and give your Tested-by as I do not own any board with such
> pinctrl device.
>
> [1] https://lore.kernel.org/u-boot/kaJS2I2TlB5214mKzY5xXgpgeJRX1riXHuO0FSKHKdxcmBCJrnYmp7s-ebQd7mIbJBd1_yubQEd2bxBUMcUK02KgDudVPXcBIdlIZRMTxF8=@bens.haus/
> ---
> drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> index 884ed258d17..ea726b96f61 100644
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> @@ -720,6 +720,8 @@ static int armada_37xx_pinctrl_probe(struct udevice *dev)
> return -ENODEV;
> }
>
> + info->dev = dev;
> +
> /*
> * we allocate functions for number of pins and hope there are
> * fewer unique functions than pins available
>
> ---
> base-commit: 77a48fa272161df9b778ffc09af814eec11cddd2
> change-id: 20260625-pinctrl-armada-37xx-devm-556d34da70a7
>
> Best regards,
> --
> Quentin Schulz <quentin.schulz at cherry.de>
>
More information about the U-Boot
mailing list