Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: twl4030-vibra - fix sibling-node lookup

A helper purported to look up a child node based on its name was using
the wrong of-helper and ended up prematurely freeing the parent of-node
while searching the whole device tree depth-first starting at the parent
node.

Fixes: 64b9e4d803b1 ("input: twl4030-vibra: Support for DT booted kernel")
Fixes: e661d0a04462 ("Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning")
Cc: stable <stable@vger.kernel.org> # 3.7
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Johan Hovold and committed by
Dmitry Torokhov
5b189201 02a0d921

+4 -2
+4 -2
drivers/input/misc/twl4030-vibra.c
··· 178 178 twl4030_vibra_suspend, twl4030_vibra_resume); 179 179 180 180 static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata, 181 - struct device_node *node) 181 + struct device_node *parent) 182 182 { 183 + struct device_node *node; 184 + 183 185 if (pdata && pdata->coexist) 184 186 return true; 185 187 186 - node = of_find_node_by_name(node, "codec"); 188 + node = of_get_child_by_name(parent, "codec"); 187 189 if (node) { 188 190 of_node_put(node); 189 191 return true;