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 F091D45A7E; Tue, 1 Oct 2024 18:38:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8759B40DF8; Tue, 1 Oct 2024 18:37:41 +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 D01CD406BA for ; Tue, 1 Oct 2024 18:37:31 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71970655611so5348971b3a.0 for ; Tue, 01 Oct 2024 09:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727800651; x=1728405451; 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=yOBZc9Z/R5CmncNxK9c6mGyjM6P04QuyUMq+4i4LYAsUxi6nceFwA6mcQjMCLHxUjk aSTwDMG3t6uSUV5/VeRhyoAaKd5n5FN7a6FOKRKuRivKBRhgj0FS3e2Ew7uDzRA3hlhr RRCF4t4gLd9DMsoOxaPTT/0oovz++/iw+4xXhDEen4yGzoPG29eVcdRNSkGHZ5It60K9 /Yk3L5pN53rOjrPuPiVyuWGC6Z9zG+s6LPX2mQc3XEJz/kaykb6KBwlru06Rd7qIYZ9c bkqVicj0cTSIyImAvoI++Kk6G6n3+hW96MKLptLGs99440IiGhy4D3j1Ge5oK9CyqCoP 7S4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727800651; x=1728405451; 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=k6hTOr5ZV4yzpS5/ASkAGGO7DbvWtUCohEAfdwtjCGjuRGabxxFnu4VnNcw+H1a2IT HkeTozXsCvbfzEgiR5AS38O3nNGopT/ESwDMLIF5NzDo/3gFKlf+v/2z0KGlafh31UK5 Wd0AO8d2nraNBW1Y3jSVbx0m6Hrb6aMT7MciNP77Ncvq2MDhYyCiVLJei3egZTvlbRdL +kC7ZlbcxjM0tu+xgc075EmPXY6R0JbIV1EDt/E1JsS9iFzP1zoUQ1c5XyaeiaDDrSCb 1jNz/7AIpP4jKJ3amTCj/rCBtiQ0ZTdMWdLRImV90Ne4CfZm5upjdcOJvvL7WTKcIAsP jmEw== X-Gm-Message-State: AOJu0YwTXCA9pWgZgx8jQQTEG22knhACrsqGtYikWUkZe5hkmLokKMSG WyeSJOyeNDnrABGE9W9A79mZXjLuCrv6iLEeAu3U7NjxrOg1QK+zuBFr2MOCyVpTW6xQRhGgRys 5n1s= X-Google-Smtp-Source: AGHT+IGhpKZaH5KRfc4gi3VRgaujk99Cyr6IO5ojDeC0HfzIX5YRqwJrw+xGB7Mrmmc3Wow+HwxORw== X-Received: by 2002:a05:6a00:4fcb:b0:70d:2e24:af75 with SMTP id d2e1a72fcca58-71dc5d5ced1mr398353b3a.24.1727800651093; Tue, 01 Oct 2024 09:37:31 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26518818sm8213565b3a.129.2024.10.01.09.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 09:37:30 -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 v5 14/17] drivers/ifpga: fix free function mismatch Date: Tue, 1 Oct 2024 09:35:37 -0700 Message-ID: <20241001163708.355128-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241001163708.355128-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241001163708.355128-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