From mboxrd@z Thu Jan 1 00:00:00 1970 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=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 DB619C433EA for ; Mon, 17 Aug 2020 17:12:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA7902072E for ; Mon, 17 Aug 2020 17:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597684324; bh=Ugj656t5RRt2/JcPvMMlruvQsjZtitRhzSD+95JsPLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yPxYGXMFAXsYFNVmviHMvH0sGAjkA1e3P5Lzv0vvm2slVfMGQnKN8zQyzLZMkBdeb hPdGhYsb6ywUAh1yiKFIp/ld56w3bDo09GKx4c3QSd9HBgH4ae7ENgBu0iIXizB8oA f/HhqsvhgGqHvh8HZVWRCqkO0wu6DfjofNOeqp3M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389412AbgHQRLo (ORCPT ); Mon, 17 Aug 2020 13:11:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:40644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388625AbgHQQLe (ORCPT ); Mon, 17 Aug 2020 12:11:34 -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 0142322CF7; Mon, 17 Aug 2020 16:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680693; bh=Ugj656t5RRt2/JcPvMMlruvQsjZtitRhzSD+95JsPLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwOgtnTZ6zB2VsNobgZb4hKHS4Zl+WwofX64EEfv/PFJ1YIpSGxxkAdwNzHM3QaRu fsDbnXWoNIwpR5lk49k8mivU+SuvXygu/LPeuXW+3ji7ns8Wl7xNxSWe8BqVU2Egc2 eswT9g83KYOsrWaq9oAFivXXMRlpQEAS/sxShPDw= 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.19 019/168] platform/x86: intel-vbtn: Fix return value check in check_acpi_dev() Date: Mon, 17 Aug 2020 17:15:50 +0200 Message-Id: <20200817143734.690697694@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 d122f33d43acb..c7c8b432c163f 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -272,7 +272,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"); -- 2.25.1