From patchwork Mon Aug 17 15:11:22 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: 266059 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=unavailable 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 81CE0C433E1 for ; Mon, 17 Aug 2020 19:10:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6021720738 for ; Mon, 17 Aug 2020 19:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597691409; bh=s2bVGAhZxzkklepQXeBLPTCF0rSqnarv9PWI2eXr2p4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uKxvH2Gq2g8CnWj5X0/Bgk1yLVMC+wEL8ZdS42pXVShP8E/N4iY4rlnUi5bGozZjM 8Vb43Ddt/LsifUsf1IbZqKFRB3VII/kInEu5yuA9B8YqPV/3I5u7mIw1e/4PcwXYkT Aov0Wdi/snla9Km7kcZExImyCgSg9Cmd5241rW00= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730775AbgHQPlw (ORCPT ); Mon, 17 Aug 2020 11:41:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:51594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730771AbgHQPlv (ORCPT ); Mon, 17 Aug 2020 11:41:51 -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 2B3B922CF8; Mon, 17 Aug 2020 15:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678910; bh=s2bVGAhZxzkklepQXeBLPTCF0rSqnarv9PWI2eXr2p4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=erC043ncfx3iLDzJbLpDv1emgeFAfNGceO3Gk1PdXyYFqTKB+npTD1/RppO/0S1kr wQZei8w57zx4gHaghQrM4u+/9L1ZzKAi6iOq4BA+SoRdcFRhz8pGzCySommJ6w/4uq 5p1NTacIl17XBsWmdVSkrcIe4SwSCI0LICU9Vkgc= 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.7 032/393] platform/x86: intel-vbtn: Fix return value check in check_acpi_dev() Date: Mon, 17 Aug 2020 17:11:22 +0200 Message-Id: <20200817143821.164685782@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 a05b80955dcdd..5db8b7ad1f5df 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -286,7 +286,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");