linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] video: fbdev: pxafb: potential NULL dereference on error
@ 2016-07-15 11:07 Dan Carpenter
  2016-07-17 15:20 ` Robert Jarzmik
  2016-08-10 10:56 ` Tomi Valkeinen
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-07-15 11:07 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Robert Jarzmik
  Cc: Tomi Valkeinen, Rafael J. Wysocki, Viresh Kumar,
	Luis R. Rodriguez, linux-fbdev, linux-kernel, kernel-janitors

If we "goto out;" then it calls display_timings_release(timings);
Since "timings" is NULL, that's going to oops.  Just return directly.

Fixes: 420a488278e8 ('video: fbdev: pxafb: initial devicetree conversion')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 2c0487f..ed41fdb 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2125,7 +2125,7 @@ static int of_get_pxafb_display(struct device *dev, struct device_node *disp,
 
 	timings = of_get_display_timings(disp);
 	if (!timings)
-		goto out;
+		return -EINVAL;
 
 	ret = -ENOMEM;
 	info->modes = kmalloc_array(timings->num_timings,

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

end of thread, other threads:[~2016-08-10 19:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 11:07 [patch] video: fbdev: pxafb: potential NULL dereference on error Dan Carpenter
2016-07-17 15:20 ` Robert Jarzmik
2016-08-10 10:56 ` Tomi Valkeinen

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).