diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-05-28 09:21:04 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-06-15 09:38:53 +0200 |
commit | 95459261c99f1621d90bc628c2a48e60b7cf9a88 (patch) | |
tree | 4c26bef401b33a653e71b69251a8a67ab741c057 | |
parent | Linux 5.8-rc1 (diff) | |
download | linux-95459261c99f1621d90bc628c2a48e60b7cf9a88.tar.xz linux-95459261c99f1621d90bc628c2a48e60b7cf9a88.zip |
hwrng: ks-sa - Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/char/hw_random/ks-sa-rng.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/hw_random/ks-sa-rng.c b/drivers/char/hw_random/ks-sa-rng.c index e2330e757f1f..001617033d6a 100644 --- a/drivers/char/hw_random/ks-sa-rng.c +++ b/drivers/char/hw_random/ks-sa-rng.c @@ -244,6 +244,7 @@ static int ks_sa_rng_probe(struct platform_device *pdev) ret = pm_runtime_get_sync(dev); if (ret < 0) { dev_err(dev, "Failed to enable SA power-domain\n"); + pm_runtime_put_noidle(dev); pm_runtime_disable(dev); return ret; } |