summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2018-12-20 19:13:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-20 10:13:11 +0100
commitda079f87f933ddb8beee0b31bad57a3e5ba230b5 (patch)
tree291d6db851f1b98d91e8d3abe6d8da8a11c28016 /drivers/video/fbdev
parent1fbbe0ccd56a59a5c07f73fe47bd60ca9a464409 (diff)
downloadlinux-stable-da079f87f933ddb8beee0b31bad57a3e5ba230b5.tar.gz
linux-stable-da079f87f933ddb8beee0b31bad57a3e5ba230b5.tar.bz2
linux-stable-da079f87f933ddb8beee0b31bad57a3e5ba230b5.zip
video: clps711x-fb: release disp device node in probe()
[ Upstream commit fdac751355cd76e049f628afe6acb8ff4b1399f7 ] 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> Cc: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/clps711x-fb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
index 649b32f78c08..c55109524fd5 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;