Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444192 > unrolled thread

[patch] video: fbdev: pxafb: potential NULL dereference on error

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-07-15 13:20 +0200
Last post2016-07-17 17:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] video: fbdev: pxafb: potential NULL dereference on error Dan Carpenter <dan.carpenter@oracle.com> - 2016-07-15 13:20 +0200
    Re: [patch] video: fbdev: pxafb: potential NULL dereference on error Robert Jarzmik <robert.jarzmik@free.fr> - 2016-07-17 17:30 +0200

#1444192 — [patch] video: fbdev: pxafb: potential NULL dereference on error

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-07-15 13:20 +0200
Subject[patch] video: fbdev: pxafb: potential NULL dereference on error
Message-ID<rV9jX-6dN-3@gated-at.bofh.it>
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,

[toc] | [next] | [standalone]


#1445056

FromRobert Jarzmik <robert.jarzmik@free.fr>
Date2016-07-17 17:30 +0200
Message-ID<rVWaZ-2s2-3@gated-at.bofh.it>
In reply to#1444192
Dan Carpenter <dan.carpenter@oracle.com> writes:

> 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>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

--
Robert

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web