aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold2017-12-29 12:48:43 -0600
committerGreg Kroah-Hartman2018-02-22 08:45:00 -0600
commit8cbb6ca49a15cc2538bec4648f1faf844ad125ad (patch)
treec3694de5be57540225033d5da41bc5653225ac70
parent6d046d9e75af120ce704f8d354d960bd0ad403ad (diff)
downloadkernel-omap-8cbb6ca49a15cc2538bec4648f1faf844ad125ad.tar.gz
kernel-omap-8cbb6ca49a15cc2538bec4648f1faf844ad125ad.tar.xz
kernel-omap-8cbb6ca49a15cc2538bec4648f1faf844ad125ad.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>
-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 19eb42b57d87..a6da82648c92 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -1120,7 +1120,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
1120 goto put_display_node; 1120 goto put_display_node;
1121 } 1121 }
1122 1122
1123 timings_np = of_find_node_by_name(display_np, "display-timings"); 1123 timings_np = of_get_child_by_name(display_np, "display-timings");
1124 if (!timings_np) { 1124 if (!timings_np) {
1125 dev_err(dev, "failed to find display-timings node\n"); 1125 dev_err(dev, "failed to find display-timings node\n");
1126 ret = -ENODEV; 1126 ret = -ENODEV;
@@ -1141,6 +1141,12 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
1141 fb_add_videomode(&fb_vm, &info->modelist); 1141 fb_add_videomode(&fb_vm, &info->modelist);
1142 } 1142 }
1143 1143
1144 /*
1145 * FIXME: Make sure we are not referencing any fields in display_np
1146 * and timings_np and drop our references to them before returning to
1147 * avoid leaking the nodes on probe deferral and driver unbind.
1148 */
1149
1144 return 0; 1150 return 0;
1145 1151
1146put_timings_node: 1152put_timings_node: