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:03 +0200
commitb07e7f3bb8f4326d529979d3c9348fbb6211951c (patch)
treecd666ad9d1a17c1bdd44801e9679f5e61f274bda
parent7014e83f0945f6b9951a2373249d0bc8ecbb4773 (diff)
downloadbarebox-b07e7f3bb8f4326d529979d3c9348fbb6211951c.tar.gz
barebox-b07e7f3bb8f4326d529979d3c9348fbb6211951c.tar.xz
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 00115317f..85603d913 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;