提交 91c73e80 编写于 作者: D Dan Carpenter 提交者: Darren Hart (VMware)

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: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NMario Limonciello <mario.limonciello@dell.com>
Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
上级 9cd5cf37
...@@ -639,6 +639,8 @@ static int dell_wmi_events_set_enabled(bool enable) ...@@ -639,6 +639,8 @@ static int dell_wmi_events_set_enabled(bool enable)
int ret; int ret;
buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL); buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
if (!buffer)
return -ENOMEM;
buffer->cmd_class = CLASS_INFO; buffer->cmd_class = CLASS_INFO;
buffer->cmd_select = SELECT_APP_REGISTRATION; buffer->cmd_select = SELECT_APP_REGISTRATION;
buffer->input[0] = 0x10000; buffer->input[0] = 0x10000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册