dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: pcf50633: pdata may be a null pointer, null pointer dereference cause crash
@ 2021-02-01 14:41 Wenjia Zhao
  2021-02-02  8:28 ` Lee Jones
  2021-02-02  9:25 ` Daniel Thompson
  0 siblings, 2 replies; 5+ messages in thread
From: Wenjia Zhao @ 2021-02-01 14:41 UTC (permalink / raw)
  Cc: Daniel Thompson, driverfuzzing, Bartlomiej Zolnierkiewicz,
	Jingoo Han, linux-fbdev, dri-devel, linux-kernel, Lee Jones

Signed-off-by: Wenjia Zhao <driverfuzzing@gmail.com>
---
 drivers/video/backlight/pcf50633-backlight.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c
index 540dd338..43267af 100644
--- a/drivers/video/backlight/pcf50633-backlight.c
+++ b/drivers/video/backlight/pcf50633-backlight.c
@@ -127,7 +127,8 @@ static int pcf50633_bl_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, pcf_bl);
 
-	pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
+  if (pdata)
+    pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
 
 	/*
 	 * Should be different from bl_props.brightness, so we do not exit
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-03 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 14:41 [PATCH] backlight: pcf50633: pdata may be a null pointer, null pointer dereference cause crash Wenjia Zhao
2021-02-02  8:28 ` Lee Jones
2021-02-02  9:25 ` Daniel Thompson
2021-02-02 21:25   ` FUZZ DR
2021-02-03 11:42     ` Daniel Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).