x86/AMD/NB: Fix amd_set_subcaches() parameter type
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 21 Jan 2014 07:22:09 +0000 (10:22 +0300)
committerIngo Molnar <mingo@kernel.org>
Sat, 25 Jan 2014 07:50:09 +0000 (08:50 +0100)
commit2993ae3305ad10b41e0d0bc2662f7754ee8e30fa
treea3ff55895017b1511896f6744e905311c1453f59
parentfb53a1ab88d14848dc292842e35c3bda3a665997
x86/AMD/NB: Fix amd_set_subcaches() parameter type

This is under CAP_SYS_ADMIN, but Smatch complains that mask comes
from the user and the test for "mask > 0xf" can underflow.

The fix is simple: amd_set_subcaches() should hand down not an 'int'
but an 'unsigned long' like it was originally indended to do.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Daniel J Blueman <daniel@numascale-asia.com>
Link: http://lkml.kernel.org/r/20140121072209.GA22095@elgon.mountain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/amd_nb.h
arch/x86/kernel/amd_nb.c