From patchwork Mon Aug 17 15:09:48 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: 266536 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, 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 0EAD3C433E1 for ; Mon, 17 Aug 2020 15:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9AF320748 for ; Mon, 17 Aug 2020 15:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677613; bh=u5wOi7YS4YqAg+29I4AjT9quQ3Dre5qXRSAwOczLa4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mYoE7YgjI0QHpDOKldpI5IRM73oBFXX6lIaljYG64BxKVBMe5F4AiO6Ch+7yxGWid UYzKXXRAHU1wgx37p0euDPCZmSsayXBfpMuuMgiqXWsncjdDBJtjn/gg24ICey4X7E 9nmMq39z1yHvRXn3kTjyKpGH3F13gtT/U+TY31VI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729250AbgHQPUK (ORCPT ); Mon, 17 Aug 2020 11:20:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729234AbgHQPTp (ORCPT ); Mon, 17 Aug 2020 11:19:45 -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 ACD1120729; Mon, 17 Aug 2020 15:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677585; bh=u5wOi7YS4YqAg+29I4AjT9quQ3Dre5qXRSAwOczLa4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJiAQp/4lMLwlNXGBupI68C5uLFD6HC1++2/RwUKG85DVlzNVI1YH8OUHZ3I7Kpmu sVLlaKfrAmvC42aQ2IPiPW1WVbYMdaNjSlhfAcMyS+xkVS1smqf+8CKUEaYeTu2P+Q kq+2kTbUwFp7jw3UFPQE7Vc9H41QWqS6zuwMnbsQ= 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 5.8 035/464] platform/x86: intel-vbtn: Fix return value check in check_acpi_dev() Date: Mon, 17 Aug 2020 17:09:48 +0200 Message-Id: <20200817143835.436238404@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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 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 Signed-off-by: Lu Wei Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- drivers/platform/x86/intel-vbtn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 0487b606a2749..e85d8e58320c1 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -299,7 +299,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-vbtn: created platform device\n");