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 D522B45A9D for ; Wed, 2 Oct 2024 17:44:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7413E40659; Wed, 2 Oct 2024 17:44:47 +0200 (CEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 08B404027C for ; Wed, 2 Oct 2024 17:44:44 +0200 (CEST) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-71b0d9535c0so4837861b3a.2 for ; Wed, 02 Oct 2024 08:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727883883; x=1728488683; 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=OCVe6ZAZ5gcdl0I1r78GjdrZqAFu9IqXRarKeyVEeiBF7gDPXJUy34oaOPH0iFXogJ Mb3wrDOeoyGDxGeFiz/T6YRvBkqsNsU3qUtncO/B3p90B2egTrjGIVZCzr3NCOE0Elt9 9g0oysVrXg6zrz98dQagUskYiNEnT912FzfOXpkS7/zOrTuWvfHIAhf+06pa0j72XjjN 1Q8PtkOzOSOY9jnqt837Ryw/JZsAbGLGv8ataY/4wE8NKnU1Xl3b6DOWbhvOwmjtHxnF iOpFIi7j+AJyM6g2v+0JvWlN3gxwUsM/hql1Gq38Zdyc7DBHDixHXC4WC7tm6+BeVGz7 4Vnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727883883; x=1728488683; 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=KeGVCMAFdDEpHningLOTnBEQPf6xoV/JTwcAJ+0+Yql3C5LxPS12D4bFmJh7qzlYBt SmDC9mLvdOeZ8Jk6nVdUZI2fpjpWw5IarwWOC5IMO90KHK34nbBRPt2BqJ7JK+2M0fTZ wh0J4nniuim4pQj0zJDsIDtB4LozY6fC0HD8lnHWuFUdCBkK/2tGhSlrfWhGekWq7iW5 Z5Ko+CrZp214EjiXy/xGysRdt4HbitFoOehJZlfQQWhtYvHIMMV1fNNQyUT8Ok7U5Tso F4jMSNJaW2Yw9N55WaEgWHOs5KtWTP9wGSsLsGxs8sbOvM/xVa1MyHjomwp1E6ksijDp b6Lw== X-Forwarded-Encrypted: i=1; AJvYcCXYZ1477c/njRevl25CNCfbyW2jhZG5uEbiwLxRSHynNTc3BqKwt6+VVDp4MWM2vXyexDF+p2E=@dpdk.org X-Gm-Message-State: AOJu0Yw0RmWNT6BWe8FF1MRI2xi/BCkVRgxVSEBHmAZXLY1WcHo7h2Mu 5Nq7WmRZcZAwFZ1FD78gJuxkNIRLberetuj6zYnVyoC7WAOUJ3K3uJkdPQfSlYg= X-Google-Smtp-Source: AGHT+IHwVEt3uzZ2rsQGrK0UF6SfgGYySmgT33YtMhITd0d9vru85L8ZPa6j4a5E2VeeASGcHgl45Q== X-Received: by 2002:a05:6a00:3c90:b0:714:1c0e:1336 with SMTP id d2e1a72fcca58-71dc5c4db9fmr6045233b3a.4.1727883883227; Wed, 02 Oct 2024 08:44:43 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2927c7sm10247363a12.1.2024.10.02.08.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:44:42 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Chengwen Feng , Maxime Coquelin , Chenbo Xia , Jin Yu Subject: [PATCH v6 05/17] examples/vhost: fix free function mismatch Date: Wed, 2 Oct 2024 08:42:49 -0700 Message-ID: <20241002154429.64357-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002154429.64357-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002154429.64357-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 Acked-by: Chengwen Feng --- 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