Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2516982pxa; Mon, 17 Aug 2020 11:35:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTQ1OwfJ6gk5+clqhq+YjANknfW5CM4Ljr9cpXHRISrQmRczDfEutDhgK0KA/jIf5dfTP2 X-Received: by 2002:a17:906:a141:: with SMTP id bu1mr16136840ejb.303.1597689345636; Mon, 17 Aug 2020 11:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597689345; cv=none; d=google.com; s=arc-20160816; b=JHddWt0kjwiTn4Ym/dCrwDw+RYkDsnPYbZi30NRpQ3OF/cEwwMeztoPBtLTnq/U0b8 nfprmJdVHDMNzErhRPOcNYzlLztMkJnmZZ2gt7+Doja/QFxnJknyrCTl5cFVvIUyQK4L 3dwwKt2w6gQbM3IPOOmiPmVk2v/WDkBbxqswORBwGaMWRJnLfE41KKqqiF2w3a3gsb2d SYx7VTTwMHpPGmfYt1Rkq8waWL7A7uGLUfbZwXqrRHxaWs6bQZJPpOinRgcBk46WadEU TPu1e2a+IpgzOz5GcrE00H2lT3CChwXknfUPhrq5OwfUMA0zfnUWf2EaSqOaxoDNgRFm kTlQ== 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=LZMm8HiXZH1r9iis1BfC+12Aj0eJeZSPU4WG3b6JX+g=; b=ddKDA8wF0Cl3YPajnBPyNYSZsuzwfTQS3aNt68YR+2rw6NO8qZltYwnS+mYWwy+Qkz 16J3InOM9eQsUj5uwyTm7HeyarRZIRTe/eFmZ3BapEUhvI88opSoX5HlV85gHB9lcvFS 6JJjQ/xpFf9us1smTbDMnd27kTLYFlhpByhy+yRfHauRSNLTSBzVrI6ce1jsp2RBzY3R +hwLByl73Kk2AhC9YrlA+/M1sjoTovDNWvqABNYqJ+76p7A8KUo90ouPs9g+zNeSfs3I ZDfRGmc+UESn3CTu7tFnxcTDNtEWa43L4rbOK57z4LQfjbXy4Ohd/PrEKG2ExlGQ+MUK xk8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mLFY5EWh; 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 d8si11258205ejj.109.2020.08.17.11.35.22; Mon, 17 Aug 2020 11:35:45 -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=mLFY5EWh; 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 S2391014AbgHQSdr (ORCPT + 99 others); Mon, 17 Aug 2020 14:33:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:47362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731016AbgHQQA2 (ORCPT ); Mon, 17 Aug 2020 12:00:28 -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 5D1CC20748; Mon, 17 Aug 2020 16:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680027; bh=oT7jG9BfMuNBbdbJS0ruyTwj9Rgd1ewmiE3dkRyR6Bo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mLFY5EWhJnp0Rqt90+jdPry7I46tDob+PEzNKsE10bhnV1EOP9i8OpEkWUub54KUt ld1tZp2hZ2CJBcQzuTnrW4vSonTxJvdlWoAXfyHO4pTCKvTnoMo5UjrXo8yPjf15al PmAHEmgd1FOGxzxbNrZzXaXuaSjX8KF8tJXYndis= 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 024/270] platform/x86: intel-hid: Fix return value check in check_acpi_dev() Date: Mon, 17 Aug 2020 17:13:45 +0200 Message-Id: <20200817143756.988406984@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 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 7a506c1d01134..ad1399dcb21f5 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -570,7 +570,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