[PATCH] pinctrl: at91-pio4: drop useless check in atmel_conf_pin_config_dbg_show()

Linus Walleij linus.walleij at linaro.org
Thu Aug 10 01:10:25 PDT 2023


On Wed, Aug 2, 2023 at 10:47 PM Sergey Shtylyov <s.shtylyov at omp.ru> wrote:

> In atmel_conf_pin_config_dbg_show(), checking atmel_pioctrl->pins[pin_id]
> against being NULL doesn't make any sense as it gets derefenced first and
> the driver's probe() method immediately returns -ENOMEM when devm_kzalloc()
> returns NULL for any atmel_pioctrl->pins[] element anyway, thus failing to
> register the device...
>
> Found by Linux Verification Center (linuxtesting.org) with the Svace static
> analysis tool.
>
> Signed-off-by: Sergey Shtylyov <s.shtylyov at omp.ru>

Patch applied!

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list