[PATCH 09/18] smb:client: Use the correct return code
Samuel Cabrero <[email protected]>
| Newsgroups | org.kernel.vger.linux-cifs |
|---|---|
| Message-ID | <[email protected]> |
Return ENOENT instead of EEXIST when a registration does not exist. Signed-off-by: Samuel Cabrero <[email protected]> --- fs/smb/client/cifs_swn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c index b823a496cba7..0d7e99203281 100644 --- a/fs/smb/client/cifs_swn.c +++ b/fs/smb/client/cifs_swn.c @@ -382,7 +382,7 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon) return swnreg; } - return ERR_PTR(-EEXIST); + return ERR_PTR(-ENOENT); } /* @@ -401,7 +401,7 @@ static struct cifs_swn_reg *cifs_get_swn_reg(struct cifs_tcon *tcon) if (!IS_ERR(swnreg)) { kref_get(&swnreg->ref_count); goto unlock; - } else if (PTR_ERR(swnreg) != -EEXIST) { + } else if (PTR_ERR(swnreg) != -ENOENT) { goto unlock; } -- 2.54.0