Patch "Input: 88pm860x-ts - fix child-node lookup" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
Input: 88pm860x-ts - fix child-node lookup
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
input-88pm860x-ts-fix-child-node-lookup.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
906bf7daa0618d0ef39f4872ca42218c29a3631fMon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Mon, 8 Jan 2018 17:20:18 -0800
Subject: Input: 88pm860x-ts - fix child-node lookup
From: Johan Hovold <[email protected]>
commit 906bf7daa0618d0ef39f4872ca42218c29a3631f upstream.
Fix child node-lookup during probe, which ended up searching the whole device tree depth-first starting at parent rather than just matching on its children.
To make things worse, the parent node was prematurely freed, while the child node was leaked.
--- drivers/input/touchscreen/88pm860x-ts.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/input/touchscreen/88pm860x-ts.c +12 -4
@@ -126,7 +126,7 @@ static int pm860x_touch_dt_init(struct pint data, n, ret;if (!np)return -ENODEV ; - np =of_find_node_by_name (np,"touch" ); + np =of_get_child_by_name (np,"touch" );if (!np) {dev_err (&pdev->dev,"Can't find touch node\n" );return -EINVAL ;
@@ -144,13 +144,13 @@ static int pm860x_touch_dt_init(struct pif (data) { ret =pm860x_reg_write (i2c,PM8607_GPADC_MISC1 , data);if (ret <0 ) -return -EINVAL ; + goto err_put_node; }/* set tsi prebias time */ if (!of_property_read_u32 (np,"marvell,88pm860x-tsi-prebias" , &data)) { ret =pm860x_reg_write (i2c,PM8607_TSI_PREBIAS , data);if (ret <0 ) -return -EINVAL ; + goto err_put_node; }/* set prebias & prechg time of pen detect */ data =0 ;
@@ -161,10 +161,18 @@ static int pm860x_touch_dt_init(struct pif (data) { ret =pm860x_reg_write (i2c,PM8607_PD_PREBIAS , data);if (ret <0 ) -return -EINVAL ; + goto err_put_node; }of_property_read_u32 (np,"marvell,88pm860x-resistor-X" , res_x); + +of_node_put (np); +return 0 ; + +err_put_node: +of_node_put (np); + + return -EINVAL; }#else #define pm860x_touch_dt_init (x, y, z) (-1)
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/input-twl4030-vibra-fix-sibling-node-lookup.patch queue-4.4/input-twl6040-vibra-fix-child-node-lookup.patch queue-4.4/input-88pm860x-ts-fix-child-node-lookup.patch