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

Commit eb60fa10 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

block: fix add_partition() error path



Partition stats structure was not freed on devt allocation failure
path.  Fix it.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 4e14e833
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk, int partno,

	err = blk_alloc_devt(p, &devt);
	if (err)
		goto out_free;
		goto out_free_stats;
	pdev->devt = devt;

	/* delay uevent until 'holders' subdir is created */
@@ -426,6 +426,8 @@ int add_partition(struct gendisk *disk, int partno,

	return 0;

out_free_stats:
	free_part_stats(p);
out_free:
	kfree(p);
	return err;