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 863C445A48; Fri, 27 Sep 2024 22:49:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D72A140B92; Fri, 27 Sep 2024 22:48:20 +0200 (CEST) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 6A61940677 for ; Fri, 27 Sep 2024 22:48:10 +0200 (CEST) Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-7db637d1e4eso2112615a12.2 for ; Fri, 27 Sep 2024 13:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727470089; x=1728074889; 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=jOgAQKhzlNU4a/PiconFQhhYxuzFpwenDzzUSKc+IEsns+mH/KyGiwLRuyFduYdiir F2jFpGQyi5reoRsjlhiKxe2oO4XEG5QPeJWJzN6mDwAxm4BNg5vp7OpUy2q8FIO2qkyt 7M10E14chpMjt9PJN6+Ra4tEFpE1toTU/NbznYYingPfodK6RaRzS31WHrfoQ8mpuNWd 0JMafuuCLpVJ6kQO7ujhufwWE1RJSJqrar+p2hlunivwnYPVDN+6aHTorYrhn06OEhtY ITbQ0D1xgU4zHqZyMBldz4OkadOmeCFP6vnCJCQuwqR2gJGeQ4if7YD8fm+krNnEeRhH 0l9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727470089; x=1728074889; 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=XkWs/sz4gwRCpHhhPWo5XE/mKqr5RJduZ4KpsIjnbuhaZ8kaj7y/+BjLGDFT7359ZC mGEzVOYTckg50xguTdcd4vKLpH3GRSWXtfXl/xWT1p5uVmd32LxjVFJ1pddeMaAoY5nv dcxeOxh59QMGurkSeyqNz8GmAZb7BMMdfgX4EyUUUSwrsENbkSrOoYuMZz66/6BeBdPF aecHyQrivKWaeXfyasJPNR32WmhQpbUFICugShAZstKTpFNYagIo5BKHtBJM3eIhMzzV yak8T7T/J4W/vXvPzDI5Hbl+FahWqIvRD14ygaaI0+T5pA80uaEeUmyBsoaCocgNBuil 4H7g== X-Gm-Message-State: AOJu0Yy8olBDHDyZeAEuelUJ32Jpde+CMQ6QWsThq9GcnRVZLtH5HuGJ h9TRcME64+9MCfnS4ZikET8inq+EoZ+7BTp+NQy0JvP3ciI6m6eUDg5g9UvpMYkaI3hNbzPACXc s X-Google-Smtp-Source: AGHT+IFKCrKTLVIbdtXCCfxZcpVJtX8K3u9kESOtHzzrz9GBJwxy4QbDN9F/d07rjbwGN/ArjgDqZA== X-Received: by 2002:a05:6a21:4d81:b0:1d2:e84a:2cb0 with SMTP id adf61e73a8af0-1d4fa6868femr5866171637.10.1727470089527; Fri, 27 Sep 2024 13:48:09 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db294533sm2036531a12.12.2024.09.27.13.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 13:48:09 -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 14/16] drivers/ifpga: fix free function mismatch Date: Fri, 27 Sep 2024 13:45:50 -0700 Message-ID: <20240927204742.546164-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240927204742.546164-1-stephen@networkplumber.org> References: <20240927204742.546164-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