Skip to contentSkip to conversation

crypto: sa2ul - Fix pm_runtime_get_sync() error checking

PATCH In review Dan Carpenter 2 participants 2 messages Sep 9, 2020 – Sep 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: sa2ul - Fix pm_runtime_get_sync() error checking

The pm_runtime_get_sync() function returns either 0 or 1 on success but this code treats a return of 1 as a failure.

Fixes 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
---
 drivers/crypto/sa2ul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/sa2ul.c +1 -1
index acabb8ddacb6..604798c65e85 100644
@@ -2333,7 +2333,7 @@ static int sa_ul_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 	ret = pm_runtime_get_sync(dev);
-	if (ret) {
+	if (ret < 0) {
 		dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__,
 			ret);
 		return ret;
Signature · 1 line
2.28.0
maintainer
#1 lore raw
Quoted 8 lines · Dan Carpenter

The pm_runtime_get_sync() function returns either 0 or 1 on success but this code treats a return of 1 as a failure.

Fixes 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
---
 drivers/crypto/sa2ul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt