crypto: hisilicon/hpre - add 'default' for switch statement
authorHui Tang <tanghui20@huawei.com>
Wed, 12 May 2021 06:27:11 +0000 (14:27 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 May 2021 08:17:31 +0000 (16:17 +0800)
Return error immediately if it goto 'default' path.

Signed-off-by: Hui Tang <tanghui20@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/hpre/hpre_crypto.c

index 7449632..294c368 100644 (file)
@@ -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)