backlight: hx8357: Fix potential NULL pointer dereference
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sun, 14 Jan 2024 14:39:21 +0000 (16:39 +0200)
committerLee Jones <lee@kernel.org>
Thu, 7 Mar 2024 09:03:28 +0000 (09:03 +0000)
commitb1ba8bcb2d1ffce11b308ce166c9cc28d989e3b9
treeaa6a5266953386dd17469e9fb9db1f6f01e63824
parent7774f3d1dd3822e938e236df67766436c0debd11
backlight: hx8357: Fix potential NULL pointer dereference

The "im" pins are optional. Add missing check in the hx8357_probe().

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/642e1230-3358-4006-a17f-3f297897ae74@moroto.mountain
Fixes: 7d84a63a39b7 ("backlight: hx8357: Convert to agnostic GPIO API")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20240114143921.550736-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/video/backlight/hx8357.c