From: Namjae Jeon namjae.jeon@samsung.com
mainline inclusion from mainline-5.15-rc1 commit 63c454f8392832a770d9cfcf9baa1733959b71e3 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA
Reference: https://git.kernel.org/torvalds/linux/c/63c454f83928
-------------------------------
WARNING: Possible unnecessary 'out of memory' message 902: FILE: fs/cifsd/smb2pdu.c:569: + if (!work->response_buf) { + ksmbd_err("Failed to allocate %zu bytes buffer\n", sz);
Fix a warning from checkpatch.pl.
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/smb2pdu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/cifsd/smb2pdu.c b/fs/cifsd/smb2pdu.c index 92b5020ae778..a18792ce96be 100644 --- a/fs/cifsd/smb2pdu.c +++ b/fs/cifsd/smb2pdu.c @@ -565,10 +565,8 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work) else work->response_buf = kvmalloc(sz, GFP_KERNEL | __GFP_ZERO);
- if (!work->response_buf) { - ksmbd_err("Failed to allocate %zu bytes buffer\n", sz); + if (!work->response_buf) return -ENOMEM; - }
work->response_sz = sz; return 0;