[bug report] pinctrl: aspeed: Improve debug output

Dan Carpenter dan.carpenter at oracle.com
Mon Feb 7 23:41:07 AEDT 2022


Hello Andrew Jeffery,

This is a semi-automatic email about new static checker warnings.

The patch aa639e443704: "pinctrl: aspeed: Improve debug output" from
Jul 1, 2020, leads to the following Smatch complaint:

    ./drivers/pinctrl/aspeed/pinctrl-aspeed.c:241 aspeed_pinmux_set_mux()
    warn: variable dereferenced before check 'pdesc' (see line 239)

./drivers/pinctrl/aspeed/pinctrl-aspeed.c
   238	
   239			pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name);
                                                           ^^^^^^^^^^^
Dereference

   240	
   241			if (!pdesc)
                             ^^^^^
Checked too late.

   242				return -EINVAL;
   243	

regards,
dan carpenter


More information about the Linux-aspeed mailing list