diff options
author | Sergey Shtylyov <s.shtylyov@omp.ru> | 2023-08-02 22:47:46 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2023-08-10 10:10:01 +0200 |
commit | c7351b46d0da5f0f1bc35187a3c924bface884e0 (patch) | |
tree | 5d2a62e18e34a289716809c99528a27239d9b195 /drivers/pinctrl/pinctrl-at91-pio4.c | |
parent | ARM: dts: ux500: switch to enable-gpios (diff) | |
download | linux-c7351b46d0da5f0f1bc35187a3c924bface884e0.tar.xz linux-c7351b46d0da5f0f1bc35187a3c924bface884e0.zip |
pinctrl: at91-pio4: drop useless check in atmel_conf_pin_config_dbg_show()
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@omp.ru>
Link: https://lore.kernel.org/r/4ab2f59f-45c1-76a2-94da-3331e8ec4e35@omp.ru
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-at91-pio4.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-at91-pio4.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 5d360ba3abc2..383309e533c3 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -939,10 +939,9 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev, if (!atmel_pioctrl->pins[pin_id]->device) return; - if (atmel_pioctrl->pins[pin_id]) - seq_printf(s, " (%s, ioset %u) ", - atmel_pioctrl->pins[pin_id]->device, - atmel_pioctrl->pins[pin_id]->ioset); + seq_printf(s, " (%s, ioset %u) ", + atmel_pioctrl->pins[pin_id]->device, + atmel_pioctrl->pins[pin_id]->ioset); conf = atmel_pin_config_read(pctldev, pin_id); if (conf & ATMEL_PIO_PUEN_MASK) |