From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbdFTUHa (ORCPT ); Tue, 20 Jun 2017 16:07:30 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45949 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbdFTUH3 (ORCPT ); Tue, 20 Jun 2017 16:07:29 -0400 Date: Tue, 20 Jun 2017 22:07:10 +0200 (CEST) From: Thomas Gleixner To: Keith Busch cc: LKML , Marc Zyngier , Christoph Hellwig , Ingo Molnar , Peter Zijlstra , Michael Ellerman , Jens Axboe , Bjorn Helgaas , linux-pci@vger.kernel.org Subject: Re: [patch 15/55] PCI: vmd: Create named irq domain In-Reply-To: <20170620200758.GC24415@localhost.localdomain> Message-ID: References: <20170619233700.547167146@linutronix.de> <20170619235444.379861978@linutronix.de> <20170620200758.GC24415@localhost.localdomain> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Jun 2017, Keith Busch wrote: > On Tue, Jun 20, 2017 at 01:37:15AM +0200, Thomas Gleixner wrote: > > static int vmd_enable_domain(struct vmd_dev *vmd) > > { > > struct pci_sysdata *sd = &vmd->sysdata; > > + struct fwnode_handle *fn; > > struct resource *res; > > u32 upper_bits; > > unsigned long flags; > > @@ -617,8 +618,13 @@ static int vmd_enable_domain(struct vmd_ > > > > sd->node = pcibus_to_node(vmd->dev->bus); > > > > - vmd->irq_domain = pci_msi_create_irq_domain(NULL, &vmd_msi_domain_info, > > + fn = irq_domain_alloc_named_id_fwnode("VMD-MSI", vmd->sysdata.domain); > > + if (!fn) > > + return -ENODEV; > > + > > + vmd->irq_domain = pci_msi_create_irq_domain(fn, &vmd_msi_domain_info, > > x86_vector_domain); > > + kfree(fn); > > If I'm following all this correctly, it looks like we need to use > irq_domain_free_fwnode with irq_domain_alloc_named_id_fwnode instead of > freeing 'fn' directly, otherwise we leak 'fwid->name'. Yes, I'm a moron.