From: Andrey Utkin Date: Mon, 14 Jul 2014 22:56:21 +0000 (+0300) Subject: drivers/platform/x86/thinkpad_acpi.c: don't test unsigned int for negativity X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bd3c7b9ef7ff26d541393e6c3e985b1c72c277c3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drivers/platform/x86/thinkpad_acpi.c: don't test unsigned int for negativity Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80231 Reported-by: David Binderman Signed-off-by: Andrey Utkin Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 0fefb2420073..61e8ff020256 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -6144,7 +6144,7 @@ static int brightness_set(unsigned int value) { int res; - if (value > bright_maxlvl || value < 0) + if (value > bright_maxlvl) return -EINVAL; vdbg_printk(TPACPI_DBG_BRGHT,