Skip to content

Commit c7351b4

Browse files
Sergey Shtylyovlinusw
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 137062f commit c7351b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/pinctrl/pinctrl-at91-pio4.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,9 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
939939
if (!atmel_pioctrl->pins[pin_id]->device)
940940
return;
941941

942-
if (atmel_pioctrl->pins[pin_id])
943-
seq_printf(s, " (%s, ioset %u) ",
944-
atmel_pioctrl->pins[pin_id]->device,
945-
atmel_pioctrl->pins[pin_id]->ioset);
942+
seq_printf(s, " (%s, ioset %u) ",
943+
atmel_pioctrl->pins[pin_id]->device,
944+
atmel_pioctrl->pins[pin_id]->ioset);
946945

947946
conf = atmel_pin_config_read(pctldev, pin_id);
948947
if (conf & ATMEL_PIO_PUEN_MASK)

0 commit comments

Comments
 (0)