video: fbdev: pxafb: potential NULL dereference on error
Subsystems (2)
PATCH 1/1 video: fbdev: pxafb: potential NULL dereference on error
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 <[email protected]>
drivers/video/fbdev/pxafb.c +1 -1
@@ -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,
Quoted 5 lines · Dan Carpenter
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 <[email protected]>
Acked-by Robert Jarzmik <[email protected]>
Cheers.
--
Robert
Quoted 12 lines · Dan Carpenter
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 <[email protected]>drivers/video/fbdev/pxafb.c +0
-0
drivers/video/fbdev/pxafb.c static int of_get_pxafb_display(struct device *dev, struct device_node *disp, · line 2131
Quoted 8 lines
drivers/video/fbdev/pxafb.c +1
-1@@ -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,
Thanks, queued for v4.9.
Tomi