public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [smatch stuff] mtd/ubi/gluebi: signedness warnings
@ 2011-10-10  9:28 Dan Carpenter
  2011-10-14  9:42 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-10-10  9:28 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: linux-mtd

Smatch complains about some to the checks in gluebi.c

drivers/mtd/ubi/gluebi.c +177 gluebi_read(6) warn: unsigned 'len' is never less than zero.
drivers/mtd/ubi/gluebi.c +221 gluebi_write(6) warn: unsigned 'len' is never less than zero.
drivers/mtd/ubi/gluebi.c +270 gluebi_erase(7) warn: unsigned 'instr->len' is never less than zero.

I think probably these checks can just be removed?  Can these things
wrap if we passed a huge value for instr->len?

   270          if (instr->len < 0 || instr->addr + instr->len > mtd->size)
   271                  return -EINVAL;

I don't know enough about how these are called to say.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-14  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10  9:28 [smatch stuff] mtd/ubi/gluebi: signedness warnings Dan Carpenter
2011-10-14  9:42 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox