aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJerome Marchand <jmarchan@redhat.com>2007-11-23 03:17:53 -0500
committerJens Axboe <jens.axboe@oracle.com>2007-11-27 03:19:40 -0500
commitc7674030e5eb83d9ba29318fb9b3ccedf84d583e (patch)
treecb11cd412c739d2cfcc5d4494ccb0ba8fc8f9920 /block
parent8c8d7214d1b35726e950db1f73317e28e827f1cd (diff)
block: Fix memory leak in alloc_disk_node()
Fix a memory leak in alloc_disk_node(). Don't forget to free 'dkstats' when the allocation of 'part' failed. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c
index e609996f2e76..f2ac914160d1 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -715,6 +715,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
715 disk->part = kmalloc_node(size, 715 disk->part = kmalloc_node(size,
716 GFP_KERNEL | __GFP_ZERO, node_id); 716 GFP_KERNEL | __GFP_ZERO, node_id);
717 if (!disk->part) { 717 if (!disk->part) {
718 free_disk_stats(disk);
718 kfree(disk); 719 kfree(disk);
719 return NULL; 720 return NULL;
720 } 721 }