summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-12-29 19:48:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-22 15:42:27 +0100
commit6e6fd5b4ea9d568ac989a61b8d78ae0c5ce19bcf (patch)
tree4db1264b7fd606c1a7b569eb05816c47b4637ea8 /drivers/video
parentc77b388550368068a1615e164b9441937786a1de (diff)
downloadlinux-stable-6e6fd5b4ea9d568ac989a61b8d78ae0c5ce19bcf.tar.gz
linux-stable-6e6fd5b4ea9d568ac989a61b8d78ae0c5ce19bcf.tar.bz2
linux-stable-6e6fd5b4ea9d568ac989a61b8d78ae0c5ce19bcf.zip
video: fbdev: atmel_lcdfb: fix display-timings lookup
commit 9cb18db0701f6b74f0c45c23ad767b3ebebe37f6 upstream. Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children. To make things worse, the parent display node was also prematurely freed. Note that the display and timings node references are never put after a successful dt-initialisation so the nodes would leak on later probe deferrals and on driver unbind. Fixes: b985172b328a ("video: atmel_lcdfb: add device tree suport") Cc: stable <stable@vger.kernel.org> # 3.13 Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/atmel_lcdfb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index e06358da4b99..3dee267d7c75 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -1119,7 +1119,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
goto put_display_node;
}
- timings_np = of_find_node_by_name(display_np, "display-timings");
+ timings_np = of_get_child_by_name(display_np, "display-timings");
if (!timings_np) {
dev_err(dev, "failed to find display-timings node\n");
ret = -ENODEV;
@@ -1140,6 +1140,12 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
fb_add_videomode(&fb_vm, &info->modelist);
}
+ /*
+ * FIXME: Make sure we are not referencing any fields in display_np
+ * and timings_np and drop our references to them before returning to
+ * avoid leaking the nodes on probe deferral and driver unbind.
+ */
+
return 0;
put_timings_node: