Skip to content

Commit d9966f1

Browse files
jhovoldgregkh
authored andcommitted
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: 886aba5 ("greybus: arche-platform: Export fn to allow...") Signed-off-by: Johan Hovold <[email protected]> Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Vaibhav Hiremath <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 55abe81 commit d9966f1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/staging/greybus/arche-platform.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ int arche_platform_change_state(enum arche_platform_state state,
186186
exit:
187187
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
188188
mutex_unlock(&arche_pdata->platform_state_mutex);
189+
put_device(&pdev->dev);
189190
of_node_put(np);
190191
return ret;
191192
}

0 commit comments

Comments
 (0)