Skip to content

Commit 532298b

Browse files
Dan Carpenterdvhart
authored andcommitted
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>
1 parent bff5bf9 commit 532298b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/platform/x86/dell-wmi.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ static int dell_wmi_events_set_enabled(bool enable)
639639
int ret;
640640

641641
buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL);
642+
if (!buffer)
643+
return -ENOMEM;
642644
buffer->cmd_class = CLASS_INFO;
643645
buffer->cmd_select = SELECT_APP_REGISTRATION;
644646
buffer->input[0] = 0x10000;

0 commit comments

Comments
 (0)