cifsd: check return value of ksmbd_vfs_getcasexattr() correctly
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 31 May 2021 08:25:05 +0000 (17:25 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Tue, 1 Jun 2021 00:26:20 +0000 (09:26 +0900)
commitfd6de099d7fabc2b86f51dc622453eb279f7cce9
tree0487242c917d5d85bf6183516e163119190319af
parent673b9ba7a1404fa5beda936b8ad509b70a516b52
cifsd: check return value of ksmbd_vfs_getcasexattr() correctly

If ksmbd_vfs_getcasexattr() returns -ENOMEM, stream_buf is NULL,
it will cause null-ptr-deref when using it to copy memory. So we
need check the return value of ksmbd_vfs_getcasexattr() by comparing
with 0.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/vfs.c