Message ID | 20191211091049.11080-1-keitasuzuki.park@sslab.ics.keio.ac.jp (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RESEND] block/genhd: Fix memory leak in error path of __alloc_disk_node() | expand |
diff --git a/block/genhd.c b/block/genhd.c index ff6268970ddc..8c4b63d7f507 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1504,6 +1504,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id) */ seqcount_init(&disk->part0.nr_sects_seq); if (hd_ref_init(&disk->part0)) { + disk_replace_part_tbl(disk, NULL); hd_free_part(&disk->part0); kfree(disk); return NULL;