Skip to content

Commit 84a85d3

Browse files
Lotte-Bailinusw
authored andcommitted
pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux()
pdesc could be null but still dereference pdesc->name and it will lead to a null pointer access. So we move a null check before dereference. Signed-off-by: Haowen Bai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent f2906aa commit 84a85d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pinctrl/aspeed/pinctrl-aspeed.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
236236
const struct aspeed_sig_expr **funcs;
237237
const struct aspeed_sig_expr ***prios;
238238

239-
pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name);
240-
241239
if (!pdesc)
242240
return -EINVAL;
243241

242+
pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name);
243+
244244
prios = pdesc->prios;
245245

246246
if (!prios)

0 commit comments

Comments
 (0)