* [-next] crypto: 842 propagate PTR_ERR value instead of -ENOMEM
@ 2017-06-01 8:57 Zhang Shengju
2017-06-19 6:28 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Shengju @ 2017-06-01 8:57 UTC (permalink / raw)
To: haren, herbert, linux-crypto
It is better to propagate PTR_ERR value instead of a hardcoded
value(-ENOMEM here).
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
crypto/842.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/842.c b/crypto/842.c
index bc26dc9..6d4f7c7 100644
--- a/crypto/842.c
+++ b/crypto/842.c
@@ -54,7 +54,7 @@ static int crypto842_init(struct crypto_tfm *tfm)
ctx->wmem = crypto842_alloc_ctx(NULL);
if (IS_ERR(ctx->wmem))
- return -ENOMEM;
+ return PTR_ERR(ctx-wmem);
return 0;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [-next] crypto: 842 propagate PTR_ERR value instead of -ENOMEM
2017-06-01 8:57 [-next] crypto: 842 propagate PTR_ERR value instead of -ENOMEM Zhang Shengju
@ 2017-06-19 6:28 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2017-06-19 6:28 UTC (permalink / raw)
To: Zhang Shengju; +Cc: haren, linux-crypto
Zhang Shengju <zhangshengju@cmss.chinamobile.com> wrote:
> It is better to propagate PTR_ERR value instead of a hardcoded
> value(-ENOMEM here).
>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
...
> - return -ENOMEM;
> + return PTR_ERR(ctx-wmem);
Please test your patches before submission.
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:[~2017-06-19 6:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01 8:57 [-next] crypto: 842 propagate PTR_ERR value instead of -ENOMEM Zhang Shengju
2017-06-19 6:28 ` 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).