aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 32ee73c67560..ed926b760ca0 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -584,7 +584,7 @@ struct block_device *bdget_disk(struct gendisk *disk, int partno)
584 struct block_device *bdev = NULL; 584 struct block_device *bdev = NULL;
585 585
586 part = disk_get_part(disk, partno); 586 part = disk_get_part(disk, partno);
587 if (part && (part->nr_sects || partno == 0)) 587 if (part)
588 bdev = bdget(part_devt(part)); 588 bdev = bdget(part_devt(part));
589 disk_put_part(part); 589 disk_put_part(part);
590 590
@@ -1031,7 +1031,7 @@ dev_t blk_lookup_devt(const char *name, int partno)
1031 continue; 1031 continue;
1032 1032
1033 part = disk_get_part(disk, partno); 1033 part = disk_get_part(disk, partno);
1034 if (part && (part->nr_sects || partno == 0)) { 1034 if (part) {
1035 devt = part_devt(part); 1035 devt = part_devt(part);
1036 disk_put_part(part); 1036 disk_put_part(part);
1037 break; 1037 break;