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 334FF45A6D; Mon, 30 Sep 2024 20:46:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB0A74068E; Mon, 30 Sep 2024 20:46:21 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id 1DE0F4027C for ; Mon, 30 Sep 2024 20:46:15 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-71798a15ce5so4364455b3a.0 for ; Mon, 30 Sep 2024 11:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727721974; x=1728326774; 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=S5gM4O39CYS7XzI3MZ+De2ffOqY5smarqIknSUAMO34N0vDY3BtaV3OgLy4yFivljZ du0hWwKtxrx+y42EbKxEOHGsyKS5lwhqCdVfYAtArxB2n1hE5GD4YmfRF93CVBeJV3Q5 eD4CiumZ8T+wKi8TU2BiMzXoJ2H766Set8EuEUMQXNlpoMSfy5cYcka9nosv1OHRhg2q SVvipV2Ivo4Svk3B3wPjDJzp13FIdQ+0Pqg4stOJpd6cRRZzDb4Z47u63DfUxy6e8ndH sbMXqyVml0QrF+LHLiAhaa6R8ZaNWJqFaMVvkqAuETTtrAetmlXk4ZsI5drU5Jb6KwfF 5y6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727721974; x=1728326774; 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=rarsqTfCxw3811WkqY1KJJZ9KQuLWGO+e7A4PlX6x0n/ZCts9m5NKNOWYh2mHhLzl4 69JO2yJjcr0KRQja+X8HZE7jc3slJ+pgiCTv1Rg5pUqRuk2ETfnzQwgXRxbb2Kyh6CAJ DgvDvejRBeT1AEjoDwioIqI24e0byYE7PJyrGEutIEeBYksSvE+lTz1hrPMhP64UFVFX 8YkbclJWL5f+jCk2coj/IZJ+00NAecfp0oXirhEs+/E6Jq1wZR3nzrLMqWBkngn46s2H iUoSD2xu8YAcJmoM/VCl/0xfrtiToeBdONAd06WgQ1Pd3TUEIuA0kuK1Cig9oS+A68Q8 VJZQ== X-Gm-Message-State: AOJu0YxX03sav2MY7uGKjf5xM2+s049Hoa973uayS2QFh01BQpXXQIVf sX1xjuqBwRBQcW/RDTXSS0h1DhTiLDEFLixYf2+9TEcqedcEQIQSf48OyFOBOzKA3kwC6xW4dB7 WDD84CQ== X-Google-Smtp-Source: AGHT+IHOzTfcs0RqINwArHLEobg3Sk3Tbv1xdfH/V7etmzPOKUsdR9FJWYtbgV2ak6AqTYokzjLXVg== X-Received: by 2002:a05:6a20:2513:b0:1d4:e40b:8990 with SMTP id adf61e73a8af0-1d52d0c43d0mr809031637.1.1727721974308; Mon, 30 Sep 2024 11:46:14 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b264bcca6sm6581895b3a.78.2024.09.30.11.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 11:46:13 -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 v4 05/17] examples/vhost: fix free function mismatch Date: Mon, 30 Sep 2024 11:43:59 -0700 Message-ID: <20240930184600.7092-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930184600.7092-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240930184600.7092-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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