Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
d9966f1d 55abe816

+1
+1
drivers/staging/greybus/arche-platform.c
··· 186 186 exit: 187 187 spin_unlock_irqrestore(&arche_pdata->wake_lock, flags); 188 188 mutex_unlock(&arche_pdata->platform_state_mutex); 189 + put_device(&pdev->dev); 189 190 of_node_put(np); 190 191 return ret; 191 192 }