]> www.infradead.org Git - users/dwmw2/linux.git/commit
leds: pca9532: fix a potential NULL pointer dereference
authorKangjie Lu <kjlu@umn.edu>
Sat, 9 Mar 2019 06:04:11 +0000 (00:04 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2019 06:49:10 +0000 (08:49 +0200)
commitb491c6f370eaac686161a0cb5cefc93a875dafed
treed408af4fbcd4952b18fe593920005c86ee1170bd
parent13103fc1d59a2f8758882f0a29df853ba6d22bf0
leds: pca9532: fix a potential NULL pointer dereference

[ Upstream commit 0aab8e4df4702b31314a27ec4b0631dfad0fae0a ]

In case of_match_device cannot find a match, return -EINVAL to avoid
NULL pointer dereference.

Fixes: fa4191a609f2 ("leds: pca9532: Add device tree support")
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
drivers/leds/leds-pca9532.c