Skip to content

Commit

Permalink
PCI/MSI: Fix leak of msi_attrs
Browse files Browse the repository at this point in the history
Coverity reported that I forgot to clean up some allocated memory on the
error path in populate_msi_sysfs(), so this patch fixes that.

Thanks to Dave Jones for pointing out where the error was, I obviously
can't read code this morning...

Found by Coverity (CID 1163317).

Fixes: 1c51b50 ("PCI/MSI: Export MSI mode using attributes, not kobjects")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Dave Jones <davej@redhat.com>
  • Loading branch information
Greg Kroah-Hartman authored and Bjorn Helgaas committed Feb 13, 2014
1 parent 86bb4f6 commit 2923775
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
++count;
msi_attr = msi_attrs[count];
}
kfree(msi_attrs);
return ret;
}

Expand Down

0 comments on commit 2923775

Please sign in to comment.