Re: [patch -next] x86, microcode, AMD: signedness bug ingeneric_load_microcode()

From: Dan Carpenter
Date: Sun Feb 20 2011 - 08:10:17 EST


On Sun, Feb 20, 2011 at 02:02:14PM +0100, Ingo Molnar wrote:
>
> * Dan Carpenter <error27@xxxxxxxxx> wrote:
>
> > install_equiv_cpu_table() returns type int. It uses negative error
> > codes so using an unsigned type breaks the error handling.
>
> How did you notice this btw - did GCC throw a warning?
>

It's a smatch warning.

arch/x86/kernel/microcode_amd.c +256 generic_load_microcode(12)
warn: unsigned 'offset' is never less than zero.

regards,
dan carpenter
--
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/