drm: panel-lvds: Potential Oops in probe error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Sep 2019 10:49:28 +0000 (13:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:20 +0000 (14:51 +0100)
commit888482cb8da0ae18e9e6af328be431e0bc76a95d
treef08c1f56b401219937af68cd157cf2891e88391a
parent97a5c6b7ff2577042299b9db218899b8e22916d1
drm: panel-lvds: Potential Oops in probe error handling

[ Upstream commit fb2ee9bf084bcaeff1e5be100decc0eacb4af2d5 ]

The "lvds->backlight" pointer could be NULL in situations where
of_parse_phandle() returns NULL.  This code is cleaner if we use the
managed devm_of_find_backlight() so the clean up is automatic.

Fixes: 7c9dff5bd643 ("drm: panels: Add LVDS panel driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190911104928.GA15930@mwanda
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panel/panel-lvds.c