kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking
@ 2020-09-09  9:45 Dan Carpenter
  2020-09-18  7:29 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-09-09  9:45 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S. Miller, Tero Kristo, Keerthy, linux-crypto, kernel-janitors

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/crypto/sa2ul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index acabb8ddacb6..604798c65e85 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -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;
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking
  2020-09-09  9:45 [PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking Dan Carpenter
@ 2020-09-18  7:29 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2020-09-18  7:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: David S. Miller, Tero Kristo, Keerthy, linux-crypto, kernel-janitors

On Wed, Sep 09, 2020 at 12:45:28PM +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/crypto/sa2ul.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-18  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09  9:45 [PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking Dan Carpenter
2020-09-18  7:29 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).