Skip to content

Commit

Permalink
cifs: Fix inconsistent IS_ERR and PTR_ERR
Browse files Browse the repository at this point in the history
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: bf80e5d ("cifs: Send witness register and unregister commands to userspace daemon")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
YueHaibing authored and Steve French committed Feb 20, 2021
1 parent 03e9bb1 commit af982da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/cifs_swn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit af982da

Please sign in to comment.