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 5700945A5D for ; Sun, 29 Sep 2024 17:41:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89747406BC; Sun, 29 Sep 2024 17:41:42 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 9EC8440663 for ; Sun, 29 Sep 2024 17:41:31 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71c5df16b10so1552042b3a.0 for ; Sun, 29 Sep 2024 08:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727624491; x=1728229291; 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=XsAhH0ZX3ddPj6j1bm6B9FX9Jp/gzrG8giI4aV5Q6Us=; b=uxASLWTamG3bbLUwiQV4Ej3WzjAdHfM8vIMyI1Hj0DI4p1+rVsxGfB74U+uNNZDoZG 07FUyd4zD2IE/iBNv4vcS6e7ZjzwFcoxvWLfjSN3i32fF5y5cGfLlG7d9oi0YkRIukNB QTv7qkhR+/O1bi4AVCWwD6MnbB+fXjsi09F0fstinvF2DSyxek/xwBGfno5FbjQDrjTu hj5S0HHCm9kY5bc+R6a1oECO8Ca3S0GfEscLl1DuYT32a9x2JxEppuPiJHHIUDA5MkCA pANs9XOSLR5S2yODt5eIkjHZa64h/ABImxlYneCyLbRhxjs9b90pH8hb2vbu886N2CX5 qi6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727624491; x=1728229291; 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=XsAhH0ZX3ddPj6j1bm6B9FX9Jp/gzrG8giI4aV5Q6Us=; b=R99JFhDNgzy8znZphPFOJF9RwSedrstH/foh2+VkriSUq6Cy72JYFS6rXP3zcP6QYj yw6z2uMbfACjoLHAcbP9QUHnJ+Q37K1e2ziFHyyAdX8mpKkK1qnBIGyYL0gBdZyBh/OV Jb0tB0GZxyqaA7ufgydZUSXJMSqLboJvRfIVuRG8dt0bJ1aF0siV2gMg9O5wzDx6Lc7o c/0ScIfCgOP4Kem5/fXQtP88Og0TLs+rjzEJslm6O2xZITDaw9yddO1oJ9QkRbaYh9kF HavkDL3MFXUrHesJr5OpZoeeu4TNCOT+swNwckB89l1shcvrIqXSt5rVe4poUwLeKMSI 9h2g== X-Forwarded-Encrypted: i=1; AJvYcCV4DnLMUCpGwBBCUf+mUE/OG49VNZ3OtbzdEo4d5oJvIV61RzKRjDORtJ0u6d2gfC5sF1I4tiw=@dpdk.org X-Gm-Message-State: AOJu0Ywdc6pse+oD4wsVN4LD/kCgMft8hXt2ETfOHy9V8yhRy6gtxk50 f31t3dfBRKqocRd40Iefs2ubRuojE55+t3yVPel+kkrH2WdkPNWhMQGozX0q/6E= X-Google-Smtp-Source: AGHT+IHCUt5j1+G/D8dfkZGjLBpc4KIOVyqh1YSjzoPxqlpi+5rlfBfNLglEAOkAffWEC019TiSCSA== X-Received: by 2002:a05:6a21:398f:b0:1d2:f124:a1cb with SMTP id adf61e73a8af0-1d4fa639a08mr12853799637.9.1727624490874; Sun, 29 Sep 2024 08:41:30 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649c775sm4707416b3a.29.2024.09.29.08.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 08:41:30 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , hkalra@marvell.com, stable@dpdk.org, Rosen Xu , David Marchand , Hyong Youb Kim Subject: [PATCH v3 14/18] drivers/ifpga: fix free function mismatch Date: Sun, 29 Sep 2024 08:34:39 -0700 Message-ID: <20240929154107.62539-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929154107.62539-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240929154107.62539-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 raw ifpga driver redefines malloc to be opae_malloc and free to be opae_free; which is a bad idea. This leads to case where interrupt efd array is allocated with calloc() and then passed to rte_free. The workaround is to allocate the array with rte_calloc() instead. Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Cc: hkalra@marvell.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/raw/ifpga/ifpga_rawdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index a972b3b7a4..86558c7b9b 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -1499,7 +1499,7 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id, nb_intr = rte_intr_nb_intr_get(*intr_handle); - intr_efds = calloc(nb_intr, sizeof(int)); + intr_efds = rte_calloc("ifpga_efds", nb_intr, sizeof(int), 0); if (!intr_efds) return -ENOMEM; @@ -1508,7 +1508,7 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id, ret = opae_acc_set_irq(acc, vec_start, count, intr_efds); if (ret) { - free(intr_efds); + rte_free(intr_efds); return -EINVAL; } } @@ -1517,13 +1517,13 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id, ret = rte_intr_callback_register(*intr_handle, handler, (void *)arg); if (ret) { - free(intr_efds); + rte_free(intr_efds); return -EINVAL; } IFPGA_RAWDEV_PMD_INFO("success register %s interrupt\n", name); - free(intr_efds); + rte_free(intr_efds); return 0; } -- 2.45.2