mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
block: fix add_partition() error path
Partition stats structure was not freed on devt allocation failure path. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
4e14e833ac
commit
eb60fa1066
1 changed files with 3 additions and 1 deletions
|
@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk, int partno,
|
||||||
|
|
||||||
err = blk_alloc_devt(p, &devt);
|
err = blk_alloc_devt(p, &devt);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_free;
|
goto out_free_stats;
|
||||||
pdev->devt = devt;
|
pdev->devt = devt;
|
||||||
|
|
||||||
/* delay uevent until 'holders' subdir is created */
|
/* delay uevent until 'holders' subdir is created */
|
||||||
|
@ -426,6 +426,8 @@ int add_partition(struct gendisk *disk, int partno,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out_free_stats:
|
||||||
|
free_part_stats(p);
|
||||||
out_free:
|
out_free:
|
||||||
kfree(p);
|
kfree(p);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in a new issue