video: fbdev: pxafb: potential NULL dereference on error
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Jul 2016 11:07:32 +0000 (14:07 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 11 Aug 2016 14:54:57 +0000 (17:54 +0300)
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>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/pxafb.c

index 2c0487f..ed41fdb 100644 (file)
@@ -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,