From patchwork Thu Aug 20 09:21:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 265761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6FD6C433E1 for ; Thu, 20 Aug 2020 10:00:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8824E207FB for ; Thu, 20 Aug 2020 10:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917627; bh=UjThr/AbDF+r+cHfs7kHV66RNhDFQIPaR76spC6viQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pRf/WtfYbRpUdYFCJPaaH51EsYNVULjopsZT6DioBVQOa2lDOoaErCUKw52CVqYCI 1AKsTvp4u3AOBTCdqU8jEovffgKWOvMa4ZvxhhCNTBZThWA7C5t+ZUB7wooqLebHWB KF+i0SjT8E9RND67u7dflYDrRkt9PWUgL9ngJgyE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729789AbgHTKAN (ORCPT ); Thu, 20 Aug 2020 06:00:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:47252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730451AbgHTJ76 (ORCPT ); Thu, 20 Aug 2020 05:59:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EBACF207FB; Thu, 20 Aug 2020 09:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917597; bh=UjThr/AbDF+r+cHfs7kHV66RNhDFQIPaR76spC6viQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LcfB/w/7WfbO/+ssDFEAd8PP+BncOcih8SrMgDZG5kdwghE2NXWKswxAjkBcyO6aw bSycQpqHV1Hw5HPfrhQAjsFIDXE84dX81nUJpuSyxD9pnqY8HQ+pKkOnwx2oQNfBxR BeH8wMrgJhg+zk5ksxUa4+VCZnxEho8Xfi/uUbPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Lu Wei , Andy Shevchenko , Sasha Levin Subject: [PATCH 4.9 087/212] platform/x86: intel-hid: Fix return value check in check_acpi_dev() Date: Thu, 20 Aug 2020 11:21:00 +0200 Message-Id: <20200820091606.742663696@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091602.251285210@linuxfoundation.org> References: <20200820091602.251285210@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lu Wei [ 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 Signed-off-by: Lu Wei Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- 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 12dbb50633761..a5c645b9e3f2a 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -264,7 +264,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");