platform/x86: intel-vbtn: Fix return value check in check_acpi_dev()
authorLu Wei <luwei32@huawei.com>
Fri, 10 Jul 2020 09:30:18 +0000 (17:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:29 +0000 (08:23 +0200)
commit56f0c3805299c7f6e9bbf574da885e3a99d578d5
tree9a3695d6d03c69c82009e139a9d3eb6843b5a667
parent61cd87c69ddb960cf83d6d479b26b0fdfe45806c
platform/x86: intel-vbtn: Fix return value check in check_acpi_dev()

[ Upstream commit 64dd4a5a7d214a07e3d9f40227ec30ac8ba8796e ]

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: 332e081225fc ("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>
drivers/platform/x86/intel-vbtn.c