Skip to content

Commit

Permalink
[PATCH] PCI: fix potential resource leak in drivers/pci/msi.c
Browse files Browse the repository at this point in the history
The coverity checker spotted (as entry #599) that we might leak `entry' in
drivers/pci/msi.c::msix_capability_init()
This patch should take care of that.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jesper Juhl authored and Greg Kroah-Hartman committed Apr 27, 2006
1 parent 9b860b8 commit f01f418
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,10 @@ static int msix_capability_init(struct pci_dev *dev,
if (!entry)
break;
vector = get_msi_vector(dev);
if (vector < 0)
if (vector < 0) {
kmem_cache_free(msi_cachep, entry);
break;
}

j = entries[i].entry;
entries[i].vector = vector;
Expand Down

0 comments on commit f01f418

Please sign in to comment.