lkml.org 
[lkml]   [2021]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.12 256/700] crypto: ux500 - Fix error return code in hash_hw_final()
    Date
    From: Zhen Lei <thunder.leizhen@huawei.com>

    [ Upstream commit b01360384009ab066940b45f34880991ea7ccbfb ]

    Fix to return a negative error code from the error handling
    case instead of 0, as done elsewhere in this function.

    Fixes: 8a63b1994c50 ("crypto: ux500 - Add driver for HASH hardware")
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/crypto/ux500/hash/hash_core.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
    index da284b0ea1b2..243515df609b 100644
    --- a/drivers/crypto/ux500/hash/hash_core.c
    +++ b/drivers/crypto/ux500/hash/hash_core.c
    @@ -1010,6 +1010,7 @@ static int hash_hw_final(struct ahash_request *req)
    goto out;
    }
    } else if (req->nbytes == 0 && ctx->keylen > 0) {
    + ret = -EPERM;
    dev_err(device_data->dev, "%s: Empty message with keylength > 0, NOT supported\n",
    __func__);
    goto out;
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-12 10:10    [W:2.943 / U:0.268 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site