Skip to content

Commit 3b3fc32

Browse files
committed
crypto: hmac - Fix incorrect error value when creating instance
If shash_alloc_instance() fails, we return the wrong error value. This patch fixes it. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 05ed875 commit 3b3fc32

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎crypto/hmac.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
195195
goto out_put_alg;
196196

197197
inst = shash_alloc_instance("hmac", alg);
198+
err = PTR_ERR(inst);
198199
if (IS_ERR(inst))
199200
goto out_put_alg;
200201

0 commit comments

Comments
 (0)