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 1033D45A6D; Mon, 30 Sep 2024 20:47:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF71540BA2; Mon, 30 Sep 2024 20:46:36 +0200 (CEST) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by mails.dpdk.org (Postfix) with ESMTP id DC45F40698 for ; Mon, 30 Sep 2024 20:46:22 +0200 (CEST) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-710de2712eeso1546375a34.3 for ; Mon, 30 Sep 2024 11:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727721982; x=1728326782; 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=HlwXgytuUX64ZyJOamrRkULBKxWqgF0FwMVkTSJo1GDaHCICnoQr3zlbPwSKDjPe2c fcpa4hk/Hzrlqp6HYx1Lpz0M3e4xdsnYTw8Vie83R1nwX1ARgbY3tSwxLTvDK7l4t65i gJ/Tfa3qn7k3nsSkk3xJwBva+KIXiF/fH5zFqPX7Sf40JuEyuXOsZTkA1fX/afmodxo0 9hwsFsdJLOiikN3lFGScvKKDpUm3WjDH6Y4WdFT+OuX14s22DzfFO6oV7tewT8k55vk0 4WJu2nRMSQov2NFbUAiRb/zEbu7FvHqdaYXu7VeCt5CXf+X//UjiqJzvogLXTxP+sW56 E9bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727721982; x=1728326782; 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=C0VeGFaScQC87SlnYZTv8BJXRHQzHD/n1ogbH5TvZ2lMHiYgSqL/3hQNhfT3Y11qvd mp2ovwSrHUClzJOU52IBMIN8M59jTi0+JbPQFCwTSSm3P5WxvDIBnWc3Wo7PLReO5Inf ZvPeIfFdCEJ00A1r7C77vTDX2pvxf2LTwMr5hKBRMAxiE4AgNEa7TSjrEzbfeVMD86SB Y3fvLy/w14IRHVAxI0/M1FUHG3GRwW4AJ5Nxu3FN16wp5S0Xib58NW2Dvhgknn3EtvZ8 129LXGjAzfC4PTVERq2pjMGT4ZagHpJBBRu0PY5XmhvuAUAcGwHUbmAysM5caLR3WOkx OyiQ== X-Gm-Message-State: AOJu0Yx9FRVFKNH6GzCJpCoSN5P8yOnVme6o6wD7dUQ/nrQc0EWbC6SR 6Dl8uwY2glolkVfXaB2q0j6rueMnBR2ngKEhs0K5PmtBDAUUfQe5uVDUQRLM1m7S5Omo7GtveHD EHy5ofw== X-Google-Smtp-Source: AGHT+IFx/zy8KkEtTxX2AgFQ2gdgyJnXRJxZCovUdmSs+QNfyb09ic63iHTGkubNiitQ4XRFAtXWlg== X-Received: by 2002:a05:6830:6583:b0:710:b797:6b0b with SMTP id 46e09a7af769-714fbeb5cabmr8330572a34.17.1727721982240; Mon, 30 Sep 2024 11:46:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 11:46:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , hkalra@marvell.com, stable@dpdk.org, Rosen Xu , Hyong Youb Kim , David Marchand Subject: [PATCH v4 14/17] drivers/ifpga: fix free function mismatch Date: Mon, 30 Sep 2024 11:44:08 -0700 Message-ID: <20240930184600.7092-15-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 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