* [PATCH] mac802154: llsec: fix return value check in llsec_key_alloc()
@ 2015-04-16 12:16 weiyj_lk
2015-04-18 13:02 ` Alexander Aring
0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2015-04-16 12:16 UTC (permalink / raw)
To: Alexander Aring, Marcel Holtmann, David S. Miller
Cc: Wei Yongjun, linux-wpan, netdev
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
In case of error, the functions crypto_alloc_aead() and crypto_alloc_blkcipher()
returns ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
net/mac802154/llsec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c
index dcf7395..5b2be12 100644
--- a/net/mac802154/llsec.c
+++ b/net/mac802154/llsec.c
@@ -134,7 +134,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template)
for (i = 0; i < ARRAY_SIZE(key->tfm); i++) {
key->tfm[i] = crypto_alloc_aead("ccm(aes)", 0,
CRYPTO_ALG_ASYNC);
- if (!key->tfm[i])
+ if (IS_ERR(key->tfm[i]))
goto err_tfm;
if (crypto_aead_setkey(key->tfm[i], template->key,
IEEE802154_LLSEC_KEY_SIZE))
@@ -144,7 +144,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template)
}
key->tfm0 = crypto_alloc_blkcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC);
- if (!key->tfm0)
+ if (IS_ERR(key->tfm0))
goto err_tfm;
if (crypto_blkcipher_setkey(key->tfm0, template->key,
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mac802154: llsec: fix return value check in llsec_key_alloc()
2015-04-16 12:16 [PATCH] mac802154: llsec: fix return value check in llsec_key_alloc() weiyj_lk
@ 2015-04-18 13:02 ` Alexander Aring
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Aring @ 2015-04-18 13:02 UTC (permalink / raw)
To: weiyj_lk
Cc: Marcel Holtmann, David S. Miller, Wei Yongjun, linux-wpan, netdev
On Thu, Apr 16, 2015 at 08:16:34PM +0800, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the functions crypto_alloc_aead() and crypto_alloc_blkcipher()
> returns ERR_PTR() and never returns NULL. The NULL test in the return value check
> should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Marcel, can you please queue this patch? Thanks.
- Alex
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-18 13:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16 12:16 [PATCH] mac802154: llsec: fix return value check in llsec_key_alloc() weiyj_lk
2015-04-18 13:02 ` Alexander Aring
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).