Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1542900pxb; Thu, 16 Sep 2021 09:34:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWCoHiDIYAGmc9d3d97OPlEqrl67oNJj7F5jLALmRzw8u25dcJchX9Du6xoM0uNRj4SYkz X-Received: by 2002:a92:c041:: with SMTP id o1mr4636057ilf.193.1631810098487; Thu, 16 Sep 2021 09:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631810098; cv=none; d=google.com; s=arc-20160816; b=uEjJSMAQETMfCbN0UXy/4u1FvDGwkkINIzgqWtli51J8BW1H1uC4X1Mq4+/WZ9PLhx 8QsDwRB/HoBPrE8V0wkXeD555r3TF17bCp/0T/kGN1lOLJn4Qi2osnqyuN+G5d09mSW8 55XhdkqvF/QJybVKzGiW3LgD66XBo8tm7MRTa8pyr+kGHbv9yR+30f11zNqKkdDva9V9 hc5wWf5XPq70xoaiijIQA21svlW1+RNKIgugm5IPkw/oi/UTNJTLWp5c9iLhvqtDt0qT oVt2SOCt28prmD5WrU8nai7af5UqZa0SE4KYihj/SmNRZ3DGQ3Am6bf24zJbonyH1sqb PEhg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xGTNgeQqXhjz4XLvvSjH//cptDWkX4BBJGmNG1pPkdE=; b=J+PDCq8jil4uVUi1Uuj0y7NwmNvTFOkgYjiAPDCK4PSLgwT6j2iwZ2t80TIP6yio7/ 1q23ktWUzL87RFZva6PINCBoyhQ48MzNV9MyWDibruvGcXa/LmabnwdMAvWKq/BiLEPp DdfsO0ga4d0QMpE58g2RUeXQNlWPsOFf57Lc2W4J2ph7GZHxNd21olfxMhnnIn12NvVd y4a3qhqalVS6WirZfv4IAWLeBhe40Sl/n6HrK6nLJl51ZhRT16D7qXW6xCIzpydpDcjV oe9FIj1B6923zgkYCN3glVXKDZ6KCVoWudXxbchubRM30Z8aGIFa/oGEkPaFigX3fvlh LonQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="G85/ySwV"; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si3125399ilj.150.2021.09.16.09.34.40; Thu, 16 Sep 2021 09:34:58 -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=@linuxfoundation.org header.s=korg header.b="G85/ySwV"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243543AbhIPQcE (ORCPT + 99 others); Thu, 16 Sep 2021 12:32:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:59300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238703AbhIPQXi (ORCPT ); Thu, 16 Sep 2021 12:23:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB35761502; Thu, 16 Sep 2021 16:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808956; bh=wm3vgGq28kagCEy8O6Nt9xmU1mL0EuDDPzYz6pRSOJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G85/ySwVyLr8JLaXcFID8EPGQeplFUOEeFxFhBiuxHOo8iAOFnAGwQPZdquOParCY CurmQaXS7VTK1MQM37cqW6tLwgwEFHvI2SZjbj9f6CHLTBGEgT3XGgjHWwEFtSvSwO K51XoVf5LsFxRrqDxXYD0gFGx+EiBJHxVB46c7MI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ding Hui , "Paulo Alcantara (SUSE)" , Steve French , Sasha Levin Subject: [PATCH 5.10 252/306] cifs: fix wrong release in sess_alloc_buffer() failed path Date: Thu, 16 Sep 2021 17:59:57 +0200 Message-Id: <20210916155802.658764736@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 1a0298d1e7cd..d58c5ffeca0d 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -888,7 +888,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