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 5AAC345A9D; Wed, 2 Oct 2024 17:45:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0C514065D; Wed, 2 Oct 2024 17:44:47 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 0A444402E9 for ; Wed, 2 Oct 2024 17:44:44 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-71c702b2d50so2748730b3a.1 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=kLCihyTu4ZqAnn1h6d4gRAdqFggVobUhqgDLL6S6Bc+fQvnTUrOGwd9B6eaYaazzi4 AEZEaslTN6XiK+ElxkHhG1dcdfs9ZLNIPm3XotPFsxxYLAHBAXtHHMhNLDNCMud0DGqu PwaO3fRolSLzGo9ks8oxOLYyFF6VYPMMck+qFs0onypYZtW6Hu6n5TQe8eastaS3nDJV MTSAttgW9QkeePjDkATiRAHV4qrvHGqdys0ZYBDPEkoDiNGmRhCFL+y76ejA2y8DZdpS RdZ33+lKwEZ3O2gUCtIMKD6+C5Gbbqa3DAzw1HORl/3z+g7mJFTsOziTwXkR1+cB2qOC p31w== X-Gm-Message-State: AOJu0YxaivamH8fYgFpWPZIYe6ki9BgI5MNCMmhL3SRazhPOHRy4eCN4 L9OBvhAPf7TTBiHFCFscu7X7Z+wrVxoJ12AEgAdg18x28XIuLvlw54cZF9Cvpv9g6u4uylUHpFB juiU= 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: 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