Skip to contentSkip to conversation

Signed Unsigned multiplication in io.c

PATCH [email protected] 2 participants 2 messages Jul 5, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

There is signed multiplication assigned to unsigned ei.addr in io.c. This causes wrong addresses for big multiplication.This patch solves the problem.

drivers/mtd/ubi/io.c +1 -1
Index: mtd-2.6/drivers/mtd/ubi/io.c
===================================================================
@@ -298,7 +298,7 @@
 	memset(&ei, 0, sizeof(struct erase_info));
 
 	ei.mtd      = ubi->mtd;
-	ei.addr     = pnum * ubi->peb_size;
+	ei.addr     = (loff_t)pnum * ubi->peb_size;
 	ei.len      = ubi->peb_size;
 	ei.callback = erase_callback;
 	ei.priv     = (unsigned long)&wq;
#1 lore raw
Quoted 5 lines · On Thu, 2007-07-05 at 15:07 +0530, [email protected] wrote:

There is signed multiplication assigned to unsigned ei.addr in io.c. This causes wrong addresses for big multiplication.This patch solves the problem.

Committed, thanks.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)