aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-12-11 05:54:27 -0500
committerDarren Hart (VMware) <dvhart@infradead.org>2017-12-11 20:26:03 -0500
commit532298b95075144bcccf56d792f3fb3fbef2d5d0 (patch)
tree98640fc28ac7dbd3663b283cb6a58f38b2783b4d
parentbff5bf9db1c9453ffd0a78abed3e2d040c092fd9 (diff)
platform/x86: dell-wmi: check for kmalloc() errors
This allocation won't fail in the current kernel because it's small but not checking for kmalloc() failures introduces static checker warnings so let's fix it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
-rw-r--r--drivers/platform/x86/dell-wmi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 39d2f4518483..fb25b20df316 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -639,6 +639,8 @@ static int dell_wmi_events_set_enabled(bool enable)
639 int ret; 639 int ret;
640 640
641 buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL); 641 buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
642 if (!buffer)
643 return -ENOMEM;
642 buffer->cmd_class = CLASS_INFO; 644 buffer->cmd_class = CLASS_INFO;
643 buffer->cmd_select = SELECT_APP_REGISTRATION; 645 buffer->cmd_select = SELECT_APP_REGISTRATION;
644 buffer->input[0] = 0x10000; 646 buffer->input[0] = 0x10000;