Commit 468d111a authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

powerpc: Fix size calculation using resource_size()

BugLink: https://bugs.launchpad.net/bugs/1797563

[ Upstream commit c42d3be0 ]

The problem is the the calculation should be "end - start + 1" but the
plus one is missing in this calculation.

Fixes: 8626816e ("powerpc: add support for MPIC message register API")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 5bdec5bf
...@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev) ...@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
/* IO map the message register block. */ /* IO map the message register block. */
of_address_to_resource(np, 0, &rsrc); of_address_to_resource(np, 0, &rsrc);
msgr_block_addr = ioremap(rsrc.start, rsrc.end - rsrc.start); msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc));
if (!msgr_block_addr) { if (!msgr_block_addr) {
dev_err(&dev->dev, "Failed to iomap MPIC message registers"); dev_err(&dev->dev, "Failed to iomap MPIC message registers");
return -EFAULT; return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment