Re: Memset of length zero bugs

From: Artem Bityutskiy
Date: Fri Nov 27 2009 - 10:04:41 EST


On Thu, 2009-11-26 at 13:07 +0200, TÃrÃk Edwin wrote:
... snip ...

> inlined from âcrosstestâ at drivers/mtd/tests/mtd_pagetest.c:219:
> /home/edwin/builds/linux-2.6/arch/x86/include/asm/string_64.h:61:
> warning: call to â__warn_memset_zero_lenâ declared with attribute
> warning: memset used with constant zero length parameter; this could be
> due to transposed parameters
>
> Now this one is interesting, the memsets are fine, however pgsize is
> always zero, it is declared as 'static int pgsize' and never assigned a
> value (hence it is always zero).
> I didn't look at what mtd_pagetest wants to test, but the name suggests
> that a pagesize of zero isn't a very useful test.

Thanks for finding this, quite shame bug. I've fixed this in my
l2-mtd-2.6.git tree:
http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/e109a419146efa5751642a11caf32b96fe187130

--
Best Regards,
Artem Bityutskiy (ÐÑÑÑÐ ÐÐÑÑÑÐÐÐ)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/