提交 d8762f9e 编写于 作者: D Dan Carpenter 提交者: Zhong Jinghua

cifsd: fix a IS_ERR() vs NULL bug

mainline inclusion
from mainline-5.15-rc1
commit 8ef32967
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G
CVE: NA

Reference: https://git.kernel.org/torvalds/linux/c/8ef329670657

-------------------------------

The smb_direct_alloc_sendmsg() function never returns NULL, it only
returns error pointers so the check needs to be updated.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
Signed-off-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
上级 bdbe73d3
......@@ -997,8 +997,8 @@ static int smb_direct_create_header(struct smb_direct_transport *t,
int ret;
sendmsg = smb_direct_alloc_sendmsg(t);
if (!sendmsg)
return -ENOMEM;
if (IS_ERR(sendmsg))
return PTR_ERR(sendmsg);
/* Fill in the packet header */
packet = (struct smb_direct_data_transfer *)sendmsg->packet;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册