]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: propagate error code of extract_sharename()
authorKatya Orlova <e.orlova@ispras.ru>
Tue, 15 Aug 2023 13:38:31 +0000 (16:38 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:28:00 +0000 (12:28 +0200)
[ Upstream commit efc0b0bcffcba60d9c6301063d25a22a4744b499 ]

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")
Signed-off-by: Katya Orlova <e.orlova@ispras.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/fscache.c

index f6f3a6b75601beaf73205191a3fb46758894b864..e73625b5d0cc682a6f87a552d50b6b4e1d776dd3 100644 (file)
@@ -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);