crypto: ccree - fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter
even when it returns an error code. However, users of cc_pm_get(),
a direct wrapper of pm_runtime_get_sync(), assume that PM usage
counter will not change on error. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Fixes: 8c7849a302
("crypto: ccree - simplify Runtime PM handling")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Родитель
39340cf97f
Коммит
b7b57a5643
|
@ -65,8 +65,12 @@ const struct dev_pm_ops ccree_pm = {
|
|||
int cc_pm_get(struct device *dev)
|
||||
{
|
||||
int rc = pm_runtime_get_sync(dev);
|
||||
if (rc < 0) {
|
||||
pm_runtime_put_noidle(dev);
|
||||
return rc;
|
||||
}
|
||||
|
||||
return (rc == 1 ? 0 : rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cc_pm_put_suspend(struct device *dev)
|
||||
|
|
Загрузка…
Ссылка в новой задаче