* [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
* Re: [patch] video: fbdev: pxafb: potential NULL dereference on error
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
1 sibling, 0 replies; 3+ messages in thread
From: Robert Jarzmik @ 2016-07-17 15:20 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Dan Carpenter
Cc: Rafael J. Wysocki, Viresh Kumar, Luis R. Rodriguez, linux-fbdev,
linux-kernel, kernel-janitors
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] video: fbdev: pxafb: potential NULL dereference on error
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
1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2016-08-10 10:56 UTC (permalink / raw)
To: Dan Carpenter, Jean-Christophe Plagniol-Villard, Robert Jarzmik
Cc: Rafael J. Wysocki, Viresh Kumar, Luis R. Rodriguez, linux-fbdev,
linux-kernel, kernel-janitors
[-- Attachment #1.1: Type: text/plain, Size: 844 bytes --]
On 15/07/16 14:07, Dan Carpenter wrote:
> 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,
>
Thanks, queued for v4.9.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [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).