Skip to content
Snippets Groups Projects
Commit b7ee5bc3 authored by Zhang Qilong's avatar Zhang Qilong Committed by Marc Kleine-Budde
Browse files

can: flexcan: fix failure handling of pm_runtime_get_sync()


pm_runtime_get_sync() will increment pm usage at first and it will resume the
device later. If runtime of the device has error or device is in inaccessible
state(or other error state), resume operation will fail. If we do not call put
operation to decrease the reference, it will result in reference leak in the
two functions flexcan_get_berr_counter() and flexcan_open().

Moreover, this device cannot enter the idle state and always stay busy or other
non-idle state later. So we should fix it through adding
pm_runtime_put_noidle().

Fixes: ca109896 ("can: flexcan: implement can Runtime PM")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201108083000.2599705-1-zhangqilong3@huawei.com


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 499aa923
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment