Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp511762pxb; Thu, 9 Sep 2021 06:10:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyTGSykZpHAg/FtDr+7NvLpwLn1jLnFAbvPxbyWWj5FBXNbctmCTcEkhy1wXhlL6XAxIBs X-Received: by 2002:a5d:914b:: with SMTP id y11mr2684574ioq.6.1631193046899; Thu, 09 Sep 2021 06:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631193046; cv=none; d=google.com; s=arc-20160816; b=ejHnee1ta9fRTQITJzNNRs3p+t/2uHfmfINKQwk0A5iV2+bnNqVzzUczfRXeHp1a7l FEioBoXsX+SO6fW3wLPDLLyn2mSNLM6ie6dGig85gSmn+8F/nzyJUKAupgjdbY5Doif9 MLduOoZ6XG5rMKTUbP1xlNm11UOZarivkDvRPz102/G5fkdv0+nFS1hecHbYJhAR19lW UiRPL3njJfYRvkjMkgy1cQWpghapzppCklHO/i1zrDtuJE5DuVXx2nOIHFezzb5qug+3 AoZ7OIHJq+dRPChmCpcovtTa4/A2ndS2UbD9/muVunrnZ7r06RlnM5k5868GdEHohQYV CpvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+5Sjmf2P4ZktpEqwOzTIfb4OLk9EvBPvO/Pei/F/iPI=; b=NmMNvOubesCpA48w/D88bFR5+nHjIPBd8EDOkcihgb9uTRGGAHUc0jRb1WVeQflnUm 6PmQgjJNKbmi6o/mMGSTdRPz3wOJpswVeRNVti9oC65jR9C/h17Pn20Q7OrQOdXjVh1c VN45YQDOFZr8G4VXOYb6PPg/EnJ7NJeoqKpvC4kEqaDNgWfVGi431c6+qeF7+xbxRE5K x3sSBbh+80eSYoVlbaenS3htwflOHghcxh+Nqy0tvFaonSeY1K24J1rFuzgzrhOvBLeg D8Pt2Yoln7dmJ1y9YTKKcBQAyQTTkwbY/Rf8WThmaTw12wYbNXDh2Cp7hXMGbWja615V Sb5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JRVaivI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si1912650ilg.5.2021.09.09.06.10.34; Thu, 09 Sep 2021 06:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JRVaivI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358487AbhIINHd (ORCPT + 99 others); Thu, 9 Sep 2021 09:07:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:40848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354393AbhIIMvJ (ORCPT ); Thu, 9 Sep 2021 08:51:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B6076322C; Thu, 9 Sep 2021 11:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188624; bh=FwCJDxS2o/rIPFeTfezYzRrapeG4sI24aIt9JPu/XhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRVaivI1+QVJJx73qf0zJUDSb3Fnlc1R+1pLLRwNw+z9VfawVLTrSqLDvieHw/53X Do+mBWuPqnLh5/sKof4SPSjbNs4cSm6abYMQ+5BLi+G4T2IpBkJIpqOn93KmzW1szZ 7G7dRRtRvNgnHv75r0XFBpP4OYbjzBIWH8SDekwY3k+Zs65d6HlnTcRkNxuSr/f0MK lb5wNme5zQmDZzVM0HznH9gaKoqF9ukcCPFJo0k+kkkLKioun5dmow4ilA0DEUMoqJ LGGggFxBLtgCU3GGE347wsbkILKbVhnyXhqTt7MSHA89/XaRW1dgOKAl3Kah+oLE8T LrsnulCtvI9fg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ding Hui , Paulo Alcantara , Steve French , Sasha Levin , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH AUTOSEL 5.4 092/109] cifs: fix wrong release in sess_alloc_buffer() failed path Date: Thu, 9 Sep 2021 07:54:49 -0400 Message-Id: <20210909115507.147917-92-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115507.147917-1-sashal@kernel.org> References: <20210909115507.147917-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ding Hui [ Upstream commit d72c74197b70bc3c95152f351a568007bffa3e11 ] smb_buf is allocated by small_smb_init_no_tc(), and buf type is CIFS_SMALL_BUFFER, so we should use cifs_small_buf_release() to release it in failed path. Signed-off-by: Ding Hui Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 85bd644f9773..30f841a880ac 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -610,7 +610,7 @@ sess_alloc_buffer(struct sess_data *sess_data, int wct) return 0; out_free_smb_buf: - kfree(smb_buf); + cifs_small_buf_release(smb_buf); sess_data->iov[0].iov_base = NULL; sess_data->iov[0].iov_len = 0; sess_data->buf0_type = CIFS_NO_BUFFER; -- 2.30.2