
From: Namjae Jeon <namjae.jeon@samsung.com> mainline inclusion from mainline-5.15-rc1 commit 533a45da1a8900267a667648450976bc334b71a8 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/533a45da1a89 ------------------------------- Add default case in switch statment in alloc_shash_desc(). Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Zhong Jinghua <zhongjinghua@huawei.com> --- fs/cifsd/crypto_ctx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifsd/crypto_ctx.c b/fs/cifsd/crypto_ctx.c index 1830ae1b5ed3..dbfe36ee9be1 100644 --- a/fs/cifsd/crypto_ctx.c +++ b/fs/cifsd/crypto_ctx.c @@ -88,6 +88,8 @@ static struct shash_desc *alloc_shash_desc(int id) case CRYPTO_SHASH_MD5: tfm = crypto_alloc_shash("md5", 0, 0); break; + default: + return NULL; } if (IS_ERR(tfm)) -- 2.31.1