From patchwork Mon Jun 28 09:02:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: RickZhong X-Patchwork-Id: 94886 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BAB3A0C3F; Mon, 28 Jun 2021 11:03:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84A6340692; Mon, 28 Jun 2021 11:03:03 +0200 (CEST) Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by mails.dpdk.org (Postfix) with ESMTP id 789534068A for ; Mon, 28 Jun 2021 11:03:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=FxsVG mpWSkiocKgap8dP5Xe5X4ElSPIYF8ZFMwW+12I=; b=goh76ZGgNpMDap/GuiirA K8y2R8higprh1N77QUwTZ+413i5FoCrZdjMnMXIHa0+fcVMNPs5k09fziuhMGo1m EvrEdf5xXqTAXoVfhFlbXCqHQoics4hd3nNo4mynTo5/ZH9WXUPfA2MFEuErSzKT DAb8rxCmRPdMVXJFPnQey4= Received: from localhost.localdomain (unknown [106.120.101.58]) by smtp9 (Coremail) with SMTP id DcCowAC3+sxBkNlgXlZCIg--.57013S2; Mon, 28 Jun 2021 17:02:58 +0800 (CST) From: RickZhong To: dev@dpdk.org Cc: RickZhong Date: Mon, 28 Jun 2021 17:02:49 +0800 Message-Id: <20210628090249.70873-1-winsome8282@163.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CM-TRANSID: DcCowAC3+sxBkNlgXlZCIg--.57013S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrur17tr4DXFy8KrWxXw1UZFb_yoWxAFX_ur savF4xXrWqvF93t34akrnxZryYkws2q3Z2vF4ft3Z3Xa42vr4kCas7ZFykGFyxGr43CF9I k3s8Jw18ur4SkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRtXo27UUUUU== X-Originating-IP: [106.120.101.58] X-CM-SenderInfo: 5zlq20dphyjmqs6rljoofrz/xtbBRRu-9FPAMun8mAABs4 Subject: [dpdk-dev] [PATCH] mem: fix mem leak issue when attaching a PCI device without driver to DPDK 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 Sender: "dev" when trying to attach a PCI device without driver to DPDK, the 'dev' is malloced but not freed. Signed-off-by: RickZhong --- drivers/bus/pci/linux/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 0dc99e9cb..909502ecc 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -332,6 +332,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) dev->kdrv = RTE_PCI_KDRV_UNKNOWN; } else { dev->kdrv = RTE_PCI_KDRV_NONE; + free(dev); return 0; } /* device is valid, add in list (sorted) */