From: Hui Tang Date: Wed, 12 May 2021 06:27:11 +0000 (+0800) Subject: crypto: hisilicon/hpre - add 'default' for switch statement X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=302e909cb22b5456ae71a9fd54b98ee0e6505613;p=linux.git crypto: hisilicon/hpre - add 'default' for switch statement Return error immediately if it goto 'default' path. Signed-off-by: Hui Tang Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 7449632986c5f..294c3688aabb0 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c @@ -623,9 +623,9 @@ static int hpre_is_dh_params_length_valid(unsigned int key_sz) case _HPRE_DH_GRP15: case _HPRE_DH_GRP16: return 0; + default: + return -EINVAL; } - - return -EINVAL; } static int hpre_dh_set_params(struct hpre_ctx *ctx, struct dh *params)