driver: input: twl6040-vibra: fix missing of_node_put
Subsystems (2)
PATCH 3/3 driver: input: twl6040-vibra: fix missing of_node_put
decrease twl6040_core_node device_node refcount after task completion
There are two ways to implement the function of_node_put through the marco CONFIG_OF_DYNAMIC, so it is save to call directly.
Signed-off-by Libo Chen <[email protected]>
--- drivers/input/misc/twl6040-vibra.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/input/misc/twl6040-vibra.c +3 -0
@@ -271,12 +271,14 @@ static int twl6040_vibra_probe(struct platform_device *pdev)#endif if (!pdata && !twl6040_core_node) { +of_node_put (twl6040_core_node);dev_err (&pdev->dev,"platform_data not available\n" );return -EINVAL ; } info =devm_kzalloc (&pdev->dev,sizeof (*info),GFP_KERNEL );if (!info) { +of_node_put (twl6040_core_node);dev_err (&pdev->dev,"couldn't allocate memory\n" );return -ENOMEM ; }
@@ -304,6 +306,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev) &vddvibl_uV);of_property_read_u32 (twl6040_core_node,"ti,vddvibr-uV" , &vddvibr_uV); +of_node_put (twl6040_core_node); } if ((!info->vibldrv_res && !info->viblmotor_res) ||
Signature · 1 line
1.7.1
Quoted 7 lines · Libo Chen
decrease
twl6040_core_nodedevice_noderefcount after task completionThere are two ways to implement the function
of_node_putthrough the marcoCONFIG_OF_DYNAMIC, so it is save to call directly.Signed-off-by Libo Chen <[email protected]>
Acked-by Peter Ujfalusi <[email protected]>
Quoted 32 lines
--- drivers/input/misc/twl6040-vibra.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)drivers/input/misc/twl6040-vibra.c +3
-0@@ -271,12 +271,14 @@ static int twl6040_vibra_probe(struct platform_device *pdev)#endif if (!pdata && !twl6040_core_node) { +of_node_put (twl6040_core_node);dev_err (&pdev->dev,"platform_data not available\n" );return -EINVAL ; } info =devm_kzalloc (&pdev->dev,sizeof (*info),GFP_KERNEL );if (!info) { +of_node_put (twl6040_core_node);dev_err (&pdev->dev,"couldn't allocate memory\n" );return -ENOMEM ; }@@ -304,6 +306,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev) &vddvibl_uV);of_property_read_u32 (twl6040_core_node,"ti,vddvibr-uV" , &vddvibr_uV); +of_node_put (twl6040_core_node); } if ((!info->vibldrv_res && !info->viblmotor_res) ||
Signature · 5 lines
Péter -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html