From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmk@arm.linux.org.uk (Russell King) Date: Mon, 06 Jun 2016 17:59:55 +0100 Subject: [PATCH kexec-tools v2 14/32] arm: fix off-by-one on memory end In-Reply-To: <20160606164129.GM1041@n2100.armlinux.org.uk> References: <20160606164129.GM1041@n2100.armlinux.org.uk> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org The memory range end is inclusive, not exclusive (see x86). We should not be adding one to the value parsed from the /proc/iomem resources. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/kexec-arm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c index 4e90e69..e47fc00 100644 --- a/kexec/arch/arm/kexec-arm.c +++ b/kexec/arch/arm/kexec-arm.c @@ -51,7 +51,6 @@ int get_memory_ranges(struct memory_range **range, int *ranges, if (count != 2) continue; str = line + consumed; - end = end + 1; if (memcmp(str, "System RAM\n", 11) == 0) { type = RANGE_RAM; -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9y2q-0006I2-1M for kexec@lists.infradead.org; Mon, 06 Jun 2016 17:10:34 +0000 In-Reply-To: <20160606164129.GM1041@n2100.armlinux.org.uk> References: <20160606164129.GM1041@n2100.armlinux.org.uk> From: Russell King Subject: [PATCH kexec-tools v2 14/32] arm: fix off-by-one on memory end MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 06 Jun 2016 17:59:55 +0100 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Pratyush Anand , Baoquan He The memory range end is inclusive, not exclusive (see x86). We should not be adding one to the value parsed from the /proc/iomem resources. Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kexec/arch/arm/kexec-arm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c index 4e90e69..e47fc00 100644 --- a/kexec/arch/arm/kexec-arm.c +++ b/kexec/arch/arm/kexec-arm.c @@ -51,7 +51,6 @@ int get_memory_ranges(struct memory_range **range, int *ranges, if (count != 2) continue; str = line + consumed; - end = end + 1; if (memcmp(str, "System RAM\n", 11) == 0) { type = RANGE_RAM; -- 1.9.1 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec