* [PATCH] video: clps711x-fb: release disp device node in probe()
@ 2018-11-02 22:23 ` Alexey Khoroshilov
0 siblings, 0 replies; 4+ messages in thread
From: Alexey Khoroshilov @ 2018-11-02 22:23 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Alexander Shiyan
Cc: Alexey Khoroshilov, linux-fbdev, linux-kernel, ldv-project
clps711x_fb_probe() increments refcnt of disp device node by
of_parse_phandle() and leaves it undecremented on both
successful and error paths.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/video/fbdev/clps711x-fb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
index ff561073ee4e..42f909618f04 100644
--- a/drivers/video/fbdev/clps711x-fb.c
+++ b/drivers/video/fbdev/clps711x-fb.c
@@ -287,14 +287,17 @@ static int clps711x_fb_probe(struct platform_device *pdev)
}
ret = of_get_fb_videomode(disp, &cfb->mode, OF_USE_NATIVE_MODE);
- if (ret)
+ if (ret) {
+ of_node_put(disp);
goto out_fb_release;
+ }
of_property_read_u32(disp, "ac-prescale", &cfb->ac_prescale);
cfb->cmap_invert = of_property_read_bool(disp, "cmap-invert");
ret = of_property_read_u32(disp, "bits-per-pixel",
&info->var.bits_per_pixel);
+ of_node_put(disp);
if (ret)
goto out_fb_release;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] video: clps711x-fb: release disp device node in probe()
@ 2018-11-02 22:23 ` Alexey Khoroshilov
0 siblings, 0 replies; 4+ messages in thread
From: Alexey Khoroshilov @ 2018-11-02 22:23 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Alexander Shiyan
Cc: Alexey Khoroshilov, linux-fbdev, linux-kernel, ldv-project
clps711x_fb_probe() increments refcnt of disp device node by
of_parse_phandle() and leaves it undecremented on both
successful and error paths.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/video/fbdev/clps711x-fb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
index ff561073ee4e..42f909618f04 100644
--- a/drivers/video/fbdev/clps711x-fb.c
+++ b/drivers/video/fbdev/clps711x-fb.c
@@ -287,14 +287,17 @@ static int clps711x_fb_probe(struct platform_device *pdev)
}
ret = of_get_fb_videomode(disp, &cfb->mode, OF_USE_NATIVE_MODE);
- if (ret)
+ if (ret) {
+ of_node_put(disp);
goto out_fb_release;
+ }
of_property_read_u32(disp, "ac-prescale", &cfb->ac_prescale);
cfb->cmap_invert = of_property_read_bool(disp, "cmap-invert");
ret = of_property_read_u32(disp, "bits-per-pixel",
&info->var.bits_per_pixel);
+ of_node_put(disp);
if (ret)
goto out_fb_release;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] video: clps711x-fb: release disp device node in probe()
2018-11-02 22:23 ` Alexey Khoroshilov
@ 2018-12-20 16:42 ` Bartlomiej Zolnierkiewicz
-1 siblings, 0 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-12-20 16:42 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Alexander Shiyan, linux-fbdev, dri-devel, linux-kernel, ldv-project
[ added dri-devel ML to Cc: ]
On 11/02/2018 11:23 PM, Alexey Khoroshilov wrote:
> clps711x_fb_probe() increments refcnt of disp device node by
> of_parse_phandle() and leaves it undecremented on both
> successful and error paths.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Patch queued for 4.21, thanks.
> ---
> drivers/video/fbdev/clps711x-fb.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
> index ff561073ee4e..42f909618f04 100644
> --- a/drivers/video/fbdev/clps711x-fb.c
> +++ b/drivers/video/fbdev/clps711x-fb.c
> @@ -287,14 +287,17 @@ static int clps711x_fb_probe(struct platform_device *pdev)
> }
>
> ret = of_get_fb_videomode(disp, &cfb->mode, OF_USE_NATIVE_MODE);
> - if (ret)
> + if (ret) {
> + of_node_put(disp);
> goto out_fb_release;
> + }
>
> of_property_read_u32(disp, "ac-prescale", &cfb->ac_prescale);
> cfb->cmap_invert = of_property_read_bool(disp, "cmap-invert");
>
> ret = of_property_read_u32(disp, "bits-per-pixel",
> &info->var.bits_per_pixel);
> + of_node_put(disp);
> if (ret)
> goto out_fb_release;
>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] video: clps711x-fb: release disp device node in probe()
@ 2018-12-20 16:42 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-12-20 16:42 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Alexander Shiyan, linux-fbdev, dri-devel, linux-kernel, ldv-project
[ added dri-devel ML to Cc: ]
On 11/02/2018 11:23 PM, Alexey Khoroshilov wrote:
> clps711x_fb_probe() increments refcnt of disp device node by
> of_parse_phandle() and leaves it undecremented on both
> successful and error paths.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Patch queued for 4.21, thanks.
> ---
> drivers/video/fbdev/clps711x-fb.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
> index ff561073ee4e..42f909618f04 100644
> --- a/drivers/video/fbdev/clps711x-fb.c
> +++ b/drivers/video/fbdev/clps711x-fb.c
> @@ -287,14 +287,17 @@ static int clps711x_fb_probe(struct platform_device *pdev)
> }
>
> ret = of_get_fb_videomode(disp, &cfb->mode, OF_USE_NATIVE_MODE);
> - if (ret)
> + if (ret) {
> + of_node_put(disp);
> goto out_fb_release;
> + }
>
> of_property_read_u32(disp, "ac-prescale", &cfb->ac_prescale);
> cfb->cmap_invert = of_property_read_bool(disp, "cmap-invert");
>
> ret = of_property_read_u32(disp, "bits-per-pixel",
> &info->var.bits_per_pixel);
> + of_node_put(disp);
> if (ret)
> goto out_fb_release;
>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-20 16:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20181102222440epcas1p3ccba6957ba132ddbbc6e32d6ff912062@epcas1p3.samsung.com>
2018-11-02 22:23 ` [PATCH] video: clps711x-fb: release disp device node in probe() Alexey Khoroshilov
2018-11-02 22:23 ` Alexey Khoroshilov
2018-12-20 16:42 ` Bartlomiej Zolnierkiewicz
2018-12-20 16:42 ` Bartlomiej Zolnierkiewicz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.