Skip to content

Commit 9545926

Browse files
dinghaoliuherbertx
authored andcommitted
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 <[email protected]> Reviewed-by: Alexander Sverdlin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent b3a9e3b commit 9545926

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/char/hw_random/ks-sa-rng.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ static int ks_sa_rng_probe(struct platform_device *pdev)
244244
ret = pm_runtime_get_sync(dev);
245245
if (ret < 0) {
246246
dev_err(dev, "Failed to enable SA power-domain\n");
247+
pm_runtime_put_noidle(dev);
247248
pm_runtime_disable(dev);
248249
return ret;
249250
}

0 commit comments

Comments
 (0)