platform/x86: wmi: Do not mix pages and kmalloc
commit6fb741076a9fc53355e56dff2e2b46782b3a46d3
authorKees Cook <keescook@chromium.org>
Wed, 20 Jun 2018 21:31:41 +0000 (20 14:31 -0700)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 22 Jun 2018 23:24:40 +0000 (22 16:24 -0700)
treec0731ea102bcbd668d8bd708de7ab08bd3c7f999
parentf193f7985f48a40885ce2e270c4cea9697650cc1
platform/x86: wmi: Do not mix pages and kmalloc

The probe handler_data was being allocated with __get_free_pages()
for no reason I could find. The error path was using kfree(). Since
other things are happily using kmalloc() in the probe path, switch to
kmalloc() entirely. This fixes the error path mismatch and will avoid
issues with CONFIG_HARDENED_USERCOPY_PAGESPAN=y.

Reported-by: Mihai Donțu <mihai.dontu@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Mario Limonciello <Mario.limonciello@dell.com>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/wmi.c