Skip to content

Commit 473a0cd

Browse files
Lu Weigregkh
authored andcommitted
platform/x86: intel-vbtn: Fix return value check in check_acpi_dev()
[ Upstream commit 64dd4a5 ] 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: 332e081 ("intel-vbtn: new driver for Intel Virtual Button") 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 d5c4d84 commit 473a0cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/platform/x86/intel-vbtn.c

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

274274
if (acpi_match_device_ids(dev, ids) == 0)
275-
if (acpi_create_platform_device(dev, NULL))
275+
if (!IS_ERR_OR_NULL(acpi_create_platform_device(dev, NULL)))
276276
dev_info(&dev->dev,
277277
"intel-vbtn: created platform device\n");
278278

0 commit comments

Comments
 (0)