public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Lu Wei <luwei32@huawei.com>, Hulk Robot <hulkci@huawei.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Sasha Levin <sashal@kernel.org>,
	platform-driver-x86@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 10/14] platform/x86: intel-hid: Fix return value check in check_acpi_dev()
Date: Sat,  8 Aug 2020 19:40:09 -0400	[thread overview]
Message-ID: <20200808234013.3619541-10-sashal@kernel.org> (raw)
In-Reply-To: <20200808234013.3619541-1-sashal@kernel.org>

From: Lu Wei <luwei32@huawei.com>

[ Upstream commit 71fbe886ce6dd0be17f20aded9c63fe58edd2806 ]

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: ecc83e52b28c ("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>
---
 drivers/platform/x86/intel-hid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index e34fd70b67afe..3add7b3f9658b 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -366,7 +366,7 @@ check_acpi_dev(acpi_handle handle, u32 lvl, void *context, void **rv)
 		return AE_OK;
 
 	if (acpi_match_device_ids(dev, ids) == 0)
-		if (acpi_create_platform_device(dev, NULL))
+		if (!IS_ERR_OR_NULL(acpi_create_platform_device(dev, NULL)))
 			dev_info(&dev->dev,
 				 "intel-hid: created platform device\n");
 
-- 
2.25.1


  parent reply	other threads:[~2020-08-08 23:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08 23:40 [PATCH AUTOSEL 4.14 01/14] x86/mce/inject: Fix a wrong assignment of i_mce.status Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 02/14] sched: correct SD_flags returned by tl->sd_flags() Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 03/14] arm64: dts: rockchip: fix rk3399-puma vcc5v0-host gpio Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 04/14] arm64: dts: rockchip: fix rk3399-puma gmac reset gpio Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 05/14] EDAC: Fix reference count leaks Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 06/14] arm64: dts: qcom: msm8916: Replace invalid bias-pull-none property Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 07/14] arm64: dts: exynos: Fix silent hang after boot on Espresso Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 08/14] m68k: mac: Don't send IOP message until channel is idle Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 09/14] m68k: mac: Fix IOP status/control register writes Sasha Levin
2020-08-08 23:40 ` Sasha Levin [this message]
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 11/14] platform/x86: intel-vbtn: Fix return value check in check_acpi_dev() Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 12/14] ARM: at91: pm: add missing put_device() call in at91_pm_sram_init() Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 13/14] spi: lantiq: fix: Rx overflow error in full duplex mode Sasha Levin
2020-08-08 23:40 ` [PATCH AUTOSEL 4.14 14/14] ARM: socfpga: PM: add missing put_device() call in socfpga_setup_ocram_self_refresh() Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200808234013.3619541-10-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hulkci@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luwei32@huawei.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox