Skip to content

Commit d5c4d84

Browse files
Lu Weigregkh
authored andcommitted
platform/x86: intel-hid: Fix return value check in check_acpi_dev()
[ Upstream commit 71fbe88 ] In the function check_acpi_dev(), if it fails to create platform device, the return value is ERR_PTR() or NULL. Thus it must use IS_ERR_OR_NULL() to check return value. Fixes: ecc83e5 ("intel-hid: new hid event driver for hotkeys") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Lu Wei <luwei32@huawei.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c060352 commit d5c4d84

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/platform/x86/intel-hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ check_acpi_dev(acpi_handle handle, u32 lvl, void *context, void **rv)
564564
return AE_OK;
565565

566566
if (acpi_match_device_ids(dev, ids) == 0)
567-
if (acpi_create_platform_device(dev, NULL))
567+
if (!IS_ERR_OR_NULL(acpi_create_platform_device(dev, NULL)))
568568
dev_info(&dev->dev,
569569
"intel-hid: created platform device\n");
570570

0 commit comments

Comments
 (0)