Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2652457pxa; Mon, 17 Aug 2020 15:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlczTWhZsWz1cPfLqt5qmbvZlCkJOYEc0Q3mzfbC4H7HAOtEhEV8oQrQLMJYW3kc+DrIxB X-Received: by 2002:a05:6402:174d:: with SMTP id v13mr16408940edx.231.1597703673035; Mon, 17 Aug 2020 15:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703673; cv=none; d=google.com; s=arc-20160816; b=Bg5s4B+Qd24sZo3B5M5+CAvK8eqLOligWcF+vKiefq6cYDO3MNkc3tEKmM69WMqV2k 8JPrG/mB2BTWXTzQ5gEzI+guzzYlZ/EoGQL6Ju2CX+fuGidZzBo087/fDiN9S8my650L ZrtFs2XvVhaNa3Y3BkRS8Lt4VGScJOHMjZfHFbHrjk+Ic5gyuhXRUoCGox/PpPX92Lt1 +Oc74AqzRhvE4n5yW7kEshWVnWkGtddACRKUn9L7d9mDK5J4ZG2qygDkndkVB67dgXhk 8oHLbihy0KsH22RatS7CmM0GyzUgaCoN4AMgS1InYiFyCmLQXsgo7g5IqEsnINj5zeEq 1z1w== 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=qPRcQ+Qv34y5txQru8w/Fsjd51SDGbtFUQ5t5M8wR8o=; b=ldML5TbUecWtCAhsRK8UYezfkVXeWDcME5Ad3rGZSr4PWqzQ8YTes8BKI+nqGV9dcV WZ0TnDquWhFdfpEdbpL4X7aEIPLHNkOZZVjwKRU+uQ5kn/8PAvZZA8HsBgxRrgTIrk8m j+NGP32tRNYbhDOWh0mWROxgWBYREE1IG0F33E+m1WbO9SXryFideN+3X3CKABrBZnUb 5kJ5EazCSlD9nSE1eBWGtQuGN/4eah0FU9Fuu+6Pxzi+8ppUBYkTczqrxZ0wU1S0deae gf1s5BtcqxnnLTah+Nr5rEzgcMkfRihV03jV3hIDyibOKVGW/lq3eprZsV3DtGuVQ7mC xG2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xj1mcSUG; 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 w18si12791106edl.306.2020.08.17.15.34.09; Mon, 17 Aug 2020 15:34:33 -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=xj1mcSUG; 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 S2389311AbgHQRLa (ORCPT + 99 others); Mon, 17 Aug 2020 13:11:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:40438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388622AbgHQQLd (ORCPT ); Mon, 17 Aug 2020 12:11:33 -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 8F95920658; Mon, 17 Aug 2020 16:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680691; bh=LHbBo7MrJEi7jSdNdXkZBGOiztoRmD1ZeW5yhPv1o0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xj1mcSUGPndCahUlnSVLHBZ2lF+6/l8LrryFlcSm+nAekLq5wvk1rxN1i5wrK/Poq +DDKnRfJk8AL9ZeCb/5hx4klU1FR3ZUnk0uFXSlxO0Vfp94yf3e2Lmz6lKNZIUAIsh neU0Mwbjfuo/jsHYTfLqdut1OYiQd6fMUNdumc78= 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 018/168] platform/x86: intel-hid: Fix return value check in check_acpi_dev() Date: Mon, 17 Aug 2020 17:15:49 +0200 Message-Id: <20200817143734.654452738@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 71fbe886ce6dd0be17f20aded9c63fe58edd2806 ] 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: ecc83e52b28c ("intel-hid: new hid event driver for hotkeys") Reported-by: Hulk Robot Signed-off-by: Lu Wei Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- drivers/platform/x86/intel-hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c index c514cb73bb500..d7d69eadb9bba 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -564,7 +564,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-hid: created platform device\n"); -- 2.25.1