Skip to contentSkip to conversation

smb: propagate error code of extract_sharename()

PATCH Applied Katya Orlova 2 participants 2 messages Aug 15, 2023 – Aug 29, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb: propagate error code of extract_sharename()

In addition to the EINVAL, there may be an ENOMEM.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 70431bfd825d ("cifs: Support fscache indexing rewrite")
---
 fs/smb/client/fscache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/fscache.c +1 -1
index 8f6909d633da..34e20c4cd507 100644
@@ -48,7 +48,7 @@ int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
 	sharename = extract_sharename(tcon->tree_name);
 	if (IS_ERR(sharename)) {
 		cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
-		return -EINVAL;
+		return PTR_ERR(sharename);
 	}
 
 	slen = strlen(sharename);
Signature · 1 line
2.30.2
#1 lore raw

Merged into cifs-2.6.git for-next

Quoted 23 lines · Katya Orlova

In addition to the EINVAL, there may be an ENOMEM.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 70431bfd825d ("cifs: Support fscache indexing rewrite")
---
  fs/smb/client/fscache.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/fscache.c +1 -1
index 8f6909d633da..34e20c4cd507 100644
@@ -48,7 +48,7 @@ int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
  	sharename = extract_sharename(tcon->tree_name);
  	if (IS_ERR(sharename)) {
  		cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
-		return -EINVAL;
+		return PTR_ERR(sharename);
  	}
 
  	slen = strlen(sharename);