Skip to content

Commit

Permalink
hwrng: ks-sa - Fix runtime PM imbalance on error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
dinghaoliu authored and herbertx committed Jun 15, 2020
1 parent b3a9e3b commit 9545926
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/char/hw_random/ks-sa-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9545926

Please sign in to comment.