cifsd: fix WARNING: Possible unnecessary 'out of memory' message
authorNamjae Jeon <namjae.jeon@samsung.com>
Tue, 20 Apr 2021 05:24:28 +0000 (14:24 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Tue, 11 May 2021 01:46:42 +0000 (10:46 +0900)
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>
fs/cifsd/smb2pdu.c

index 92b5020..a18792c 100644 (file)
@@ -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;