[PATCH v2] drm: panel-lvds: Potential Oops in probe error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "lvds->backlight" pointer could be NULL in situations were
of_parse_phandle() returns NULL.  Also it's slightly cleaner to use
backlight_put() which already has a check for NULL built in.

Fixes: 7c9dff5bd643 ("drm: panels: Add LVDS panel driver")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
v2: Use backlight_put().  Thanks, Laurent!

 drivers/gpu/drm/panel/panel-lvds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index ad47cc95459e..05e8885db7ed 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -272,7 +272,7 @@ static int panel_lvds_probe(struct platform_device *pdev)
 	return 0;
 
 error:
-	put_device(&lvds->backlight->dev);
+	backlight_put(lvds->backlight);
 	return ret;
 }
 
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux