提交 af982da9 编写于 作者: Y YueHaibing 提交者: Steve French

cifs: Fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in cifs_find_swn_reg(). The proper
pointer to be passed as argument to PTR_ERR() is share_name.

This bug was detected with the help of Coccinelle.

Fixes: bf80e5d4 ("cifs: Send witness register and unregister commands to userspace daemon")
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Reviewed-by: NSamuel Cabrero <scabrero@suse.de>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 03e9bb1a
......@@ -272,7 +272,7 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon)
if (IS_ERR(share_name)) {
int ret;
ret = PTR_ERR(net_name);
ret = PTR_ERR(share_name);
cifs_dbg(VFS, "%s: failed to extract share name from target '%s': %d\n",
__func__, tcon->treeName, ret);
kfree(net_name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册