Skip to contentSkip to conversation

cpuidle: add put_device() after of_find_device_by_node()

PATCH Applied Yang Li 1 participant 1 message Dec 10, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 2/2 cpuidle: add put_device() after of_find_device_by_node()

This was found by coccicheck:
./drivers/cpuidle/cpuidle-qcom-spm.c:129:1-7: ERROR: missing put_device; call of_find_device_by_node on line 103, but without a corresponding object release within this function.

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpuidle/cpuidle-qcom-spm.c +1 -0
index 01e77913a414..3952ea600122 100644
@@ -111,6 +111,7 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENOMEM;
 
 	data->spm = dev_get_drvdata(&pdev->dev);
+	put_device(&pdev->dev);
 	if (!data->spm)
 		return -EINVAL;
 
Signature · 1 line
2.20.1.7.g153144c