Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7674030 authored by Jerome Marchand's avatar Jerome Marchand Committed by Jens Axboe
Browse files

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: default avatarJerome Marchand <jmarchan@redhat.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 8c8d7214
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -715,6 +715,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
			disk->part = kmalloc_node(size,
				GFP_KERNEL | __GFP_ZERO, node_id);
			if (!disk->part) {
				free_disk_stats(disk);
				kfree(disk);
				return NULL;
			}