]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: single: fix potential NULL dereference
authorMaxim Korotkov <korotkov.maxim.s@gmail.com>
Fri, 18 Nov 2022 10:43:32 +0000 (13:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:50:32 +0000 (12:50 +0100)
commit05ef05309fcd02f0f5a23c89b8eb7a16fdb7d428
tree8773543098449efc97cce7f8b211b46050b528c9
parentf68e2c24dce29c5435a3ac1f2e12e3365f894c78
pinctrl: single: fix potential NULL dereference

[ Upstream commit d2d73e6d4822140445ad4a7b1c6091e0f5fe703b ]

Added checking of pointer "function" in pcs_set_mux().
pinmux_generic_get_function() can return NULL and the pointer
"function" was dereferenced without checking against NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 0b0e8d9367ac ("pinctrl: single: Use generic pinmux helpers for managing functions")
Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221118104332.943-1-korotkov.maxim.s@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-single.c