summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2014-10-22 12:47:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-23 07:31:31 +0200
commit51ece5e1d6d4b2fcc707cd908094d5e7e7d1f5d6 (patch)
tree139fbd0a1c4cca524c9325ffc5196d0225611ecd
parentde19c2b48de5afb66141f61c4b799ef575b214c0 (diff)
downloadbarebox-51ece5e1d6d4b2fcc707cd908094d5e7e7d1f5d6.tar.gz
EFI: report correct block device size
last_block is a zero-based block number, so the total number of blocks is last_block + 1 Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/efi/efi/efi-block-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/efi/efi/efi-block-io.c b/arch/efi/efi/efi-block-io.c
index 0011531..85603d9 100644
--- a/arch/efi/efi/efi-block-io.c
+++ b/arch/efi/efi/efi-block-io.c
@@ -149,7 +149,7 @@ int efi_bio_probe(struct efi_device *efidev)
priv->blk.cdev.name = asprintf("disk%d", cdev_find_free_index("disk"));
priv->blk.blockbits = ffs(media->block_size) - 1;
- priv->blk.num_blocks = media->last_block;
+ priv->blk.num_blocks = media->last_block + 1;
priv->blk.ops = &efi_bio_ops;
priv->blk.dev = &efidev->dev;