Skip to content

Commit 2923775

Browse files
gregkhbjorn-helgaas
authored andcommitted
PCI/MSI: Fix leak of msi_attrs
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>
1 parent 86bb4f6 commit 2923775

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pci/msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
595595
++count;
596596
msi_attr = msi_attrs[count];
597597
}
598+
kfree(msi_attrs);
598599
return ret;
599600
}
600601

0 commit comments

Comments
 (0)