lkml.org 
[lkml]   [2017]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 15/55] PCI: vmd: Create named irq domain
On Tue, 20 Jun 2017, Thomas Gleixner wrote:
> 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.

Fixed up the mess and updated the git branch.

Thanks for catching it.

tglx

\
 
 \ /
  Last update: 2017-06-20 22:41    [W:0.112 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site