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 A2DB445AE3
	for <public@inbox.dpdk.org>; Tue,  8 Oct 2024 18:49:06 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6089740E2A;
	Tue,  8 Oct 2024 18:49:03 +0200 (CEST)
Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com
 [209.85.214.177])
 by mails.dpdk.org (Postfix) with ESMTP id E9E7840B8C
 for <stable@dpdk.org>; Tue,  8 Oct 2024 18:48:57 +0200 (CEST)
Received: by mail-pl1-f177.google.com with SMTP id
 d9443c01a7336-20b78ee6298so37702355ad.2
 for <stable@dpdk.org>; Tue, 08 Oct 2024 09:48:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406137;
 x=1729010937; 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=NKlsSE/ils/BNwzrbn82mcXaZhpj81/i4C0+pjHpynM=;
 b=g8RhIesTWtrpBnXExt6FRINVc8C7RRLGgCeI1HNArjKPs/Y3nte1a+6Eecq+xwgAGV
 JNNjQ6yaN0QlwQDo1Df9c0w2TMrqHxsSkaMON+DL4CNBSkEk/u4SzFLyV7iR0qqGX6I0
 u4hyxvcUkdxdydN9jjXeMuZsEQUKDADaQeDYYI6KTC4GEBcUDPycIb1sr/i+xCL2I7TP
 iaVZ7ydX6FLzAir/dacIY0Kb7GfqaadgRBDK6WbGTF4ggSRBGHtaf5DO3NW21GNbNmNn
 BvdO3++CHvMvWVVBvvGh7+sAMxf3eCsjid/M8dfsQfFMRfnPaFOQCGC2YIamkaOkyvAY
 wdkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728406137; x=1729010937;
 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=NKlsSE/ils/BNwzrbn82mcXaZhpj81/i4C0+pjHpynM=;
 b=RygXF0VY1zsMhVkgcInE1o1Jo1t71P2GepQsAQJ6jca8QXVY/MfwhPfS/2OASm3G9v
 gKNDy11EPA2JnsIoBWXKx/jHyCluUojJTJCtdf7cXnXkZlB5swq2CUjDCWEbiXkSITnV
 dTllwrxUJM0pQPrDUGUKlmJ97iWVXnOZ2Rtu40TQygDXGKd/QTHjKmro8iyBcBNKdOgV
 M/SsLiFWh0/THlAwe6ssRGYN6Twh2D5zkMjuhhTiBZ+pP3AnJB8iH0wyGWjyDPL7EsAD
 H0Z8q5KhMMF95zL42q+++cLyk6ezMDBPiLHqyuKSQB9acamlSLmWngtrELKt6C8c9+6R
 gStw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVx6UzuUn64OhIaP1LzVFQU4y8TpuYBX8SdQSA/MeIy77lMPA0t/c/9122GKesRWMkImJh0CSo=@dpdk.org
X-Gm-Message-State: AOJu0YwBabQdA1ARHzfE+/0ZQPfoxEBodXaOnpd34Q5du46DQqDRYTrO
 7Z7oKitw4UGv1SOf2IHFmJx2V5Z9WdGM1dP/sr/FGwEr85AmpoIrN4TKS29Esm0=
X-Google-Smtp-Source: AGHT+IET2iir6da7pJ/xyUdsR0rbukbu8V54lyP8rYc/LarXZGHkORnFX4BqFnF5mfjHk0MZDdyqEg==
X-Received: by 2002:a17:903:2447:b0:20b:bdbf:da82 with SMTP id
 d9443c01a7336-20bfde554famr260564305ad.9.1728406137112; 
 Tue, 08 Oct 2024 09:48:57 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c54056bd9sm13832965ad.85.2024.10.08.09.48.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 08 Oct 2024 09:48:56 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, stable@dpdk.org,
 Chengwen Feng <fengchengwen@huawei.com>,
 Maxime Coquelin <maxime.coquelin@redhat.com>,
 Chenbo Xia <chenbox@nvidia.com>, Jin Yu <jin.yu@intel.com>
Subject: [PATCH v9 05/17] examples/vhost: fix free function mismatch
Date: Tue,  8 Oct 2024 09:47:09 -0700
Message-ID: <20241008164842.139045-6-stephen@networkplumber.org>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20241008164842.139045-1-stephen@networkplumber.org>
References: <20240927204742.546164-1-stephen@networkplumber.org>
 <20241008164842.139045-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: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 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