From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 32B9145A48
	for <public@inbox.dpdk.org>; Fri, 27 Sep 2024 22:48:12 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 880ED4066F;
	Fri, 27 Sep 2024 22:48:09 +0200 (CEST)
Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com
 [209.85.215.180])
 by mails.dpdk.org (Postfix) with ESMTP id 5A21A40430
 for <stable@dpdk.org>; Fri, 27 Sep 2024 22:48:02 +0200 (CEST)
Received: by mail-pg1-f180.google.com with SMTP id
 41be03b00d2f7-70b2421471aso1654035a12.0
 for <stable@dpdk.org>; Fri, 27 Sep 2024 13:48:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727470081;
 x=1728074881; darn=dpdk.org; 
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=qX5JnPmSsf+JiqhomIoZSRVblyTHeI0U9/zFsuxKGzU=;
 b=23T729Z1qr0cTmiqpsVZPvssHB8qOW7sloOASFwvVwvEMsJqb3srRCd0JT1dduv+yr
 uwqPxb1UziVeARQud2jQ/LPw1ePxni1AQRmyRot2cWZOjZa7x9YVGHc7+KWW9AhTvUj6
 2EkQ+/uaL48/+L8U2WcSTyPfcPITv9klmnulOns+BSk0ybNKtEiW3VKlqmlmJDuVk3q6
 dI6glJphS/MDYoYip0HeZb1ht4Oi7Z+BeSZ3NInv5doeFcw7Ad+8qyg+pc43+9dckZ0p
 FjuYQymuPJWDKu/k3Om8tVfb80T6BP3cpZZ224a8ukBQkbVtR5obdjbvoY2YP0VmAjaA
 JK3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727470081; x=1728074881;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=qX5JnPmSsf+JiqhomIoZSRVblyTHeI0U9/zFsuxKGzU=;
 b=smsOymE+nxkRovfjUcBORY4sCq81wHuYZrlHjFcdH5Q8QSP09aQjjqRBc53IOC0vj5
 aQgcuBHW5v88DtZpwz3HgQkGw2l07d6mSK7/xWgzSaVZ+kIwDEmrMrjuDPOT/tX2cwOf
 iqM4TH/NThJHr908KKjl5om/Oqe7t70yaA1CmVmD18DzLbJf6WOZjod2UQsAJcA0AYHw
 jMfwBesJNBCtG99QuNmT+sGiEEkkYlksUwIoLR3+flJ40lJyRnv8ZCJEs1HNtL0Rs1zU
 c450r7BYKQOSqTiaEArxh/AnpzrYIrTcOXBdA40f0x2BVDyUF0+DVWEtTWXQoFZfySOf
 8l1Q==
X-Forwarded-Encrypted: i=1;
 AJvYcCUIVa20EvNQRHvkIIkWEfa8/OvvExAyShwuSwT6BVjm7v2w9za2zId16sOrUvFu56S5Nc1cmjc=@dpdk.org
X-Gm-Message-State: AOJu0Yz0NprjMfQN4az/of3lQEmGG0Uj8atIgqJkt9tOIhOsLlyI5f1+
 9IYzm3kotifxdkCITBVUtLSUfvq5nQGt+/3iRgNkN6dqYVy/2gQNp2aOLkQSJDs=
X-Google-Smtp-Source: AGHT+IGyAm6wls3XOqJ1Lg5YotTiFe91RZOJnEw116asLJ6cfIFRBMk+pSAo8Uvf+XRcH+nn8avYIg==
X-Received: by 2002:a05:6a20:d521:b0:1d2:bb49:63ac with SMTP id
 adf61e73a8af0-1d4fa7ae4b5mr6057117637.40.1727470081512; 
 Fri, 27 Sep 2024 13:48:01 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-7e6db294533sm2036531a12.12.2024.09.27.13.48.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 27 Sep 2024 13:48:01 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, jin.yu@intel.com,
 stable@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>,
 Chenbo Xia <chenbox@nvidia.com>
Subject: [PATCH 06/16] examples/vhost: fix free function mismatch
Date: Fri, 27 Sep 2024 13:45:42 -0700
Message-ID: <20240927204742.546164-7-stephen@networkplumber.org>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240927204742.546164-1-stephen@networkplumber.org>
References: <20240927204742.546164-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

The pointer bdev is allocated with rte_zmalloc() and then
incorrectly freed with free() which will lead pool corruption.

Bugzilla ID: 1553
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: jin.yu@intel.com
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/vhost_blk/vhost_blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 03f1ac9c3f..9c9e326949 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -776,7 +776,7 @@ vhost_blk_bdev_construct(const char *bdev_name,
 	bdev->data = rte_zmalloc(NULL, blk_cnt * blk_size, 0);
 	if (!bdev->data) {
 		fprintf(stderr, "No enough reserved huge memory for disk\n");
-		free(bdev);
+		rte_free(bdev);
 		return NULL;
 	}
 
-- 
2.45.2