From: Namjae Jeon Date: Tue, 20 Apr 2021 05:24:28 +0000 (+0900) Subject: cifsd: fix WARNING: Possible unnecessary 'out of memory' message X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=63c454f8392832a770d9cfcf9baa1733959b71e3;p=linux.git cifsd: fix WARNING: Possible unnecessary 'out of memory' message 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 Signed-off-by: Steve French --- diff --git a/fs/cifsd/smb2pdu.c b/fs/cifsd/smb2pdu.c index 92b5020ae7786..a18792ce96bef 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;