Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2517863pxa; Mon, 17 Aug 2020 11:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdwUtZgJs11FIZaBfvhuuEdglxieGhYRP0H0RsvdSlNHk4EbHMTQHz0PJw1qDJplQ0WAoH X-Received: by 2002:a17:906:a8f:: with SMTP id y15mr16118679ejf.140.1597689425510; Mon, 17 Aug 2020 11:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597689425; cv=none; d=google.com; s=arc-20160816; b=DL3shiHUwYWX4pdFYOvrkop2xxuyx9sDIu3wqFbHG6tm/+wYfRMVrr6UKkrX6F+8xS CZKhER4xtFE5TJiqciKEfzPYBxQqFGFUq981KOjVa1QD7S6sQpTnLu7lqMJ/+zAHcmE7 mB0UNGge3TzSNpkYCNE8iYNudlxa6Ogj4K57asTbBEofWQAcNYknzP5VslW2OO217FCu W+1DOgnIcSZoC1/Me/yyPoZplLIWYqHL7PRFgVxGKQdgr58KEfzLwvhMftHnwzEhtDZG 3fy/bDWSV7ZIuPVI42Enc76VhCMWEcG4SXpAB/wZsU1+02GwUZnTwviyW9ztIkfqzAsX Sr/w== 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=sa19H5N37cP6pKgWwVLC9IirL2ieCBljL8QD9MbmgsE=; b=DjyT5Qp0e575jjaum3zLjVqIcn994LCFOpR12TthY37+Eib5UTr6sBLFQLVxVSJZiF ewCCXE6pWBvMXxAAuY5va3c8yE+ocYxW1LnEQ6kZaLFNxgXKQOaiwMjnxZZb3+iCR//a tsXQUKQsbX0FrQ5PqDUaugfhrVvXvHJj3PQBT2f7Nn7caBxKEpu7wjHlkWtHi54b4Lh0 Z4zcUPawuUj2JaScXZUHwdVkCaThZQ0/k2hYb/o7HLokxtCZhMCwoVleaR6aFzz8s07q mMdRhHDIunUTJqEsEbOPYlVvwGSWxc8b5rKBHTljH8Ki1BMAmWeEsP5wXDevyByds80v ArdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F1iliXh9; 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 b21si11810390eja.19.2020.08.17.11.36.42; Mon, 17 Aug 2020 11:37:05 -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=F1iliXh9; 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 S2390756AbgHQSdW (ORCPT + 99 others); Mon, 17 Aug 2020 14:33:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:47142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731020AbgHQQAa (ORCPT ); Mon, 17 Aug 2020 12:00:30 -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 D3006206FA; Mon, 17 Aug 2020 16:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680030; bh=671qMzywyiO9upLORWnHQgMmYgw/Iu86jshCUde0boc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F1iliXh9qVKsH6Qn33vFEp6oIlC9IUt/1ng4frKwZnfSLMwmXrK9bKrGMg16KDgCr oSIpPo5UL1P1lPIoakGk8V7/aB84xIy+ZLpBY+q0LGYVSyLhmBu6aDBoH2scqT10lq 5dJj4bIveKY+2krkk0ae8lYIhaaQMAgpYNkpm8rc= 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.4 025/270] platform/x86: intel-vbtn: Fix return value check in check_acpi_dev() Date: Mon, 17 Aug 2020 17:13:46 +0200 Message-Id: <20200817143757.036494552@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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 cb2a80fdd8f46..3393ee95077f6 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"); -- 2.25.1