]> git.baikalelectronics.ru Git - kernel.git/commit
dell-wmi: Clean up hotkey table size check
authorAndy Lutomirski <luto@kernel.org>
Mon, 15 Feb 2016 16:32:35 +0000 (08:32 -0800)
committerDarren Hart <dvhart@linux.intel.com>
Wed, 23 Mar 2016 17:05:45 +0000 (10:05 -0700)
commitb93d2dd0cf86b568feda1a951b348997e43d19ce
treec19747a3335a857e84e78d8ff0c3fa956a8876c3
parent1deea2f365d1cd6bbe1d950d122abce3dea63420
dell-wmi: Clean up hotkey table size check

Checking the table for a minimum size of 7 bytes makes no sense: any valid
hotkey table has a size that's a multiple of 4.

Clean this up: replace the hardcoded header length with a sizeof and
change the check to ignore an empty hotkey table.  The only behavior
change is that a 7-byte table (which is nonsensical) will now be
treated as absent instead of as valid but empty.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/dell-wmi.c