From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A75DCA0C4B for ; Tue, 13 Jul 2021 11:37:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 986EF4120F; Tue, 13 Jul 2021 11:37:37 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 148524069E; Tue, 13 Jul 2021 11:37:35 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id AE10F7F53F; Tue, 13 Jul 2021 12:37:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru AE10F7F53F DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1626169054; bh=irSKhEYMTeQktkAgHehUyTEyX0tp7KVcFv9vbhVc224=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=eT5cmbTnfDr6nTLP4ibXnh6eFWZ/8z7xLMyVTr/Lo2NptQHNKYhH0dr3/WdWBQyJj jmzxZXH8Or/HPYDah+rCUI1TWIWQ3GNnevMw9vrTPfRtbcXEyElSr6IqLNxlCEgNWc JnH9rDPKPbxk3fLG7tp0oN6e+89vycczAaNzzURU= To: dapengx.yu@intel.com, Jasvinder Singh , Cristian Dumitrescu Cc: dev@dpdk.org, stable@dpdk.org References: <20210709060056.957949-1-dapengx.yu@intel.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <034efec5-86f3-82c3-ff51-822b5fd1dd52@oktetlabs.ru> Date: Tue, 13 Jul 2021 12:37:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210709060056.957949-1-dapengx.yu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/softnic: fix memory leak in connection init X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 7/9/21 9:00 AM, dapengx.yu@intel.com wrote: > From: Dapeng Yu > > In function softnic_conn_init(), a block of memory is allocated as > connection buffer, but it is never freed in softnic_conn_free(), > which cause memory leak. > > This patch fixes it. > > Fixes: 7709a63bf178 ("net/softnic: add connection agent") > Cc: stable@dpdk.org > > Signed-off-by: Dapeng Yu > --- > drivers/net/softnic/conn.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/softnic/conn.c b/drivers/net/softnic/conn.c > index 8b66580887..a9548beac7 100644 > --- a/drivers/net/softnic/conn.c > +++ b/drivers/net/softnic/conn.c > @@ -146,6 +146,7 @@ softnic_conn_free(struct softnic_conn *conn) > free(conn->msg_in); > free(conn->prompt); > free(conn->welcome); > + free(conn->buf); > free(conn); > } > > Fixed order to free in reverse order vs fields in the structure and allocation. Reviewed-by: Andrew Rybchenko Applied, thanks.