Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2652474pxa; Mon, 17 Aug 2020 15:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZZ0EaO0bfM6FbJ2n4/dnp4lqN77L+W1s5OSQ0j1MR5FYmy/1cpfsC1RCFu1QZqlrQ0NMA X-Received: by 2002:a17:906:3b83:: with SMTP id u3mr17081700ejf.55.1597703674458; Mon, 17 Aug 2020 15:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703674; cv=none; d=google.com; s=arc-20160816; b=wGVgoMQr+84whb3awGKK07oBECJTuZ6pVa6R1Bl7idWF9ThlI/mjsF2wcpRT0Yrl3s 8hknP++vAp+4WA8bLWLpNa6Zzkkb+faOfvlx3RKX2CmOnyO7q+pVGZH28WZ4doWaTD20 fkx8EQHcIL+Tli8sci3sCKXfR5CueikupT1cZZ4Iqkx//PLSQ/NN8n69xMLctgWkl1YJ ny1NGhCGqGYxqd1MTkEhOZqvvIJpkrQVC+30lctQ9VukATMCF7iLFV10xienKsXkGp7/ skZ7OkzANVDqyVYPA4owUawIENiybbt+Wnc8WjMMJYs1j7W66Ipaj98hvLA2AVCmCZA3 +0bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oSs8EDZ+k6rXYiK7v4aNtCOzueD5JQtAim3JVJdJU34=; b=P6YJqhduLNFlFQb3P3fRsQKX4M3CwSozX7yrq3HpkTVpr/OLVbBtYSTlARTOKNlYu1 s+haXEoBlx4Xycp8g52J6XgB7YZljf6fHDkRK6M+Ztydz7tsWa4SCyyKuA9nrlagsCd/ IVnkOX85KJJ30o3j8iUtD4PzHQBE39qRgKLDW6HfEnxq4dINDbxMLlzHXkzHojJu3Ngc EFNAIe1w8NCiBAA5aiR3S2AbCLOyiijOX22SreCSeGlB7CGz9t+z6/i1VkDaijI2SRHq mhqLxpAjLC+TAj+TtxEZLUjB/Fk1hSwj4Pwe8C3Uud1EuwaUNI0xmaUg5bVPUkMp0BRj CXRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IwOgtnTZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n28si13811743eda.478.2020.08.17.15.34.11; Mon, 17 Aug 2020 15:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IwOgtnTZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389441AbgHQRLi (ORCPT + 99 others); Mon, 17 Aug 2020 13:11:38 -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