[PATCH] fix potential resource leak in drivers/pci/msi.c

From: Jesper Juhl
Date: Sun Apr 16 2006 - 22:07:22 EST


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@xxxxxxxxx>
---

--- linux-2.6.17-rc1-git12-orig/drivers/pci/msi.c 2006-04-16 11:23:18.000000000 +0200
+++ linux-2.6.17-rc1-git12/drivers/pci/msi.c 2006-04-17 03:59:14.000000000 +0200
@@ -793,8 +793,10 @@ static int msix_capability_init(struct p
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;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/