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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
---

--- 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux