浏览代码

staging: greybus: arche-platform: fix device reference leak

Make sure to drop the device reference taken by of_find_device_by_node()
before returning from arche_platform_change_state().

Note that this code is expected to be removed, but let's fix up the leak
nonetheless.

Fixes: 886aba558b9e ("greybus: arche-platform: Export fn to allow...")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold 9 年之前
父节点
当前提交
d9966f1de9
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/staging/greybus/arche-platform.c

+ 1 - 0
drivers/staging/greybus/arche-platform.c

@@ -186,6 +186,7 @@ int arche_platform_change_state(enum arche_platform_state state,
 exit:
 exit:
 	spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
 	spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
 	mutex_unlock(&arche_pdata->platform_state_mutex);
 	mutex_unlock(&arche_pdata->platform_state_mutex);
+	put_device(&pdev->dev);
 	of_node_put(np);
 	of_node_put(np);
 	return ret;
 	return ret;
 }
 }