aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-platform.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2016-11-01 11:55:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-07 11:45:42 +0100
commitd9966f1de990577b49903061cfcea2d1e85353fb (patch)
treeab1469c8b0f68f0286fb9a356c118a4f2441ae4a /drivers/staging/greybus/arche-platform.c
parentstaging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value (diff)
downloadlinux-dev-d9966f1de990577b49903061cfcea2d1e85353fb.tar.xz
linux-dev-d9966f1de990577b49903061cfcea2d1e85353fb.zip
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>
Diffstat (limited to 'drivers/staging/greybus/arche-platform.c')
-rw-r--r--drivers/staging/greybus/arche-platform.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index 34307ac3f255..d33d6fe078ad 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -186,6 +186,7 @@ int arche_platform_change_state(enum arche_platform_state state,
exit:
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
mutex_unlock(&arche_pdata->platform_state_mutex);
+ put_device(&pdev->dev);
of_node_put(np);
return ret;
}