mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
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>
This commit is contained in:
parent
8c8d7214d1
commit
c7674030e5
1 changed files with 1 additions and 0 deletions
|
@ -715,6 +715,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
|
||||||
disk->part = kmalloc_node(size,
|
disk->part = kmalloc_node(size,
|
||||||
GFP_KERNEL | __GFP_ZERO, node_id);
|
GFP_KERNEL | __GFP_ZERO, node_id);
|
||||||
if (!disk->part) {
|
if (!disk->part) {
|
||||||
|
free_disk_stats(disk);
|
||||||
kfree(disk);
|
kfree(disk);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue