From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 796977461 for ; Sun, 17 Sep 2023 19:48:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF08BC433C9; Sun, 17 Sep 2023 19:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694980138; bh=mfJIOIaTYeZADi+9UgeSH0ZfbxVKQiqN4GJNAd1eY5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MYdB3pZxw++YmLJkceqjOtVOn3SOOEP6NBguBNLqSfVf+9u80rqUH94Ono+WEojZT x48q3LL+j55AnEqOvDuUFmJkBF4Ob0JTP2aBAI/wbb1SUOn7JUxyjR/Ju0za2MjAM4 cdNnzp4a6Ray9u4cUfVIsYlw0Ffhnl0jsdp78HT0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Katya Orlova , Steve French , Sasha Levin Subject: [PATCH 6.5 106/285] smb: propagate error code of extract_sharename() Date: Sun, 17 Sep 2023 21:11:46 +0200 Message-ID: <20230917191055.336253103@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230917191051.639202302@linuxfoundation.org> References: <20230917191051.639202302@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Katya Orlova [ 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 Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/client/fscache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/fscache.c b/fs/smb/client/fscache.c index 8f6909d633da8..34e20c4cd507f 100644 --- a/fs/smb/client/fscache.c +++ b/fs/smb/client/fscache.c @@ -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); -- 2.40.1