提交 ef49d40b 编写于 作者: D Dinghao Liu 提交者: Jens Axboe

block: Fix an error handling in add_partition

Once we have called device_initialize(), we should use put_device() to
give up the reference on error, just like what we have done on failure
of device_add().
Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 2569063c
......@@ -384,7 +384,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,
err = blk_alloc_devt(bdev, &devt);
if (err)
goto out_bdput;
goto out_put;
pdev->devt = devt;
/* delay uevent until 'holders' subdir is created */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册