mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
powerpc: Fix size calculation using resource_size()
[ Upstream commitc42d3be0c0] The problem is the the calculation should be "end - start + 1" but the plus one is missing in this calculation. Fixes:8626816e90("powerpc: add support for MPIC message register API") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c20a5e06b7
commit
af675a6eef
@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
|
||||
|
||||
/* IO map the message register block. */
|
||||
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) {
|
||||
dev_err(&dev->dev, "Failed to iomap MPIC message registers");
|
||||
return -EFAULT;
|
||||
|
||||
Reference in New Issue
Block a user