leds: pca9532: fix a potential NULL pointer dereference
authorKangjie Lu <kjlu@umn.edu>
Sat, 9 Mar 2019 06:04:11 +0000 (00:04 -0600)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sat, 30 Mar 2019 17:50:00 +0000 (18:50 +0100)
commit0aab8e4df4702b31314a27ec4b0631dfad0fae0a
treeb6c1a7919caf3c642e674ec56ae2b1f85bdb6566
parent4cb6560514fa19d556954b88128f3846fee66a03
leds: pca9532: fix a potential NULL pointer dereference

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>
drivers/leds/leds-pca9532.c