]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mfd: ene-kb3930: Fix a potential NULL pointer dereference
authorChenyuan Yang <chenyuan0y@gmail.com>
Mon, 24 Feb 2025 23:37:36 +0000 (17:37 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:43:41 +0000 (10:43 +0200)
commit2edb5b29b197d90b4d08cd45e911c0bcf24cb895
tree9a8cc98af80e9925b96e2477e67137dd5f8c5d36
parent3b4643ffaf72d7a5a357e9bf68b1775f8cfe7e77
mfd: ene-kb3930: Fix a potential NULL pointer dereference

commit 4cdf1d2a816a93fa02f7b6b5492dc7f55af2a199 upstream.

The off_gpios could be NULL. Add missing check in the kb3930_probe().
This is similar to the issue fixed in commit b1ba8bcb2d1f
("backlight: hx8357: Fix potential NULL pointer dereference").

This was detected by our static analysis tool.

Cc: stable@vger.kernel.org
Fixes: ede6b2d1dfc0 ("mfd: ene-kb3930: Add driver for ENE KB3930 Embedded Controller")
Suggested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Link: https://lore.kernel.org/r/20250224233736.1919739-1-chenyuan0y@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mfd/ene-kb3930.c