Skip to content

Commit

Permalink
block: use disk_part_iter_exit in disk_part_iter_next
Browse files Browse the repository at this point in the history
Call disk_part_iter_exit in disk_part_iter_next instead of duplicating
the functionality.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Dec 1, 2020
1 parent 8d65269 commit e79319a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter)
int inc, end;

/* put the last partition */
disk_put_part(piter->part);
piter->part = NULL;
disk_part_iter_exit(piter);

/* get part_tbl */
rcu_read_lock();
Expand Down

0 comments on commit e79319a

Please sign in to comment.