Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | From | Jesper Juhl <> | Subject | [PATCH] fix potential resource leak in drivers/pci/msi.c | Date | Mon, 17 Apr 2006 04:02:54 +0200 |
| |
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> ---
--- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |