mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 15:44:13 +08:00
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>
This commit is contained in:
parent
137062f11c
commit
c7351b46d0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user