Skip to contentSkip to conversation

off-by-one error in physmap.c

PATCH Sascha Hauer 2 participants 2 messages Jun 26, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

This patch fixes a simple off-by-one error in the mtd physmap driver.

Sascha

drivers/mtd/maps/physmap.c +1 -1
index 433c3ca..d6301f0 100644
@@ -182,7 +182,7 @@ static struct physmap_flash_data physmap
 
 static struct resource physmap_flash_resource = {
 	.start		= CONFIG_MTD_PHYSMAP_START,
-	.end		= CONFIG_MTD_PHYSMAP_START + CONFIG_MTD_PHYSMAP_LEN,
+	.end		= CONFIG_MTD_PHYSMAP_START + CONFIG_MTD_PHYSMAP_LEN - 1,
 	.flags		= IORESOURCE_MEM,
 };
 
#1 lore raw
Quoted 1 line · Sascha Hauer

This patch fixes a simple off-by-one error in the mtd physmap driver.

Looks good.

Quoted 1 line
Quoted 12 lines
drivers/mtd/maps/physmap.c +1 -1
index 433c3ca..d6301f0 100644
@@ -182,7 +182,7 @@ static struct physmap_flash_data physmap
 
 static struct resource physmap_flash_resource = {
 	.start		= CONFIG_MTD_PHYSMAP_START,
-	.end		= CONFIG_MTD_PHYSMAP_START + CONFIG_MTD_PHYSMAP_LEN,
+	.end		= CONFIG_MTD_PHYSMAP_START + CONFIG_MTD_PHYSMAP_LEN - 1,
 	.flags		= IORESOURCE_MEM,
 };