Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp390212ybt; Fri, 10 Jul 2020 02:29:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ/NvF3UdbVM46uDl0+BVzVqu7qZypx06XNqWdSKY8qv8caSGa83cHHY3Ty/VF6bzZAq5W X-Received: by 2002:a17:907:1114:: with SMTP id qu20mr62527968ejb.41.1594373340865; Fri, 10 Jul 2020 02:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594373340; cv=none; d=google.com; s=arc-20160816; b=O/B+d3GjwuA9PA6DIow8RFChIjRduD+y9vYfFFzgcEI+Rf2hdcf4gHFSPrAjlOYjfx JtN8l6Zttf0pLrbK1qLI5HKGFlRoE068IUEO2hA9SLM4129JZtaIHhoWhQMt7nTfe+0t NwWmDsdfHh7cRuN4czsYg1Vve0T1ARULOvmnSWgCOr3iSR9BXQlkMMeF2j0kOteQvJsu 1YIjinOv7H8NFrOcTSE6zuI6KSe9z0wOac0LWPbI+DpsUfgfMuNbsbLT3Mr+i4z2/dTJ 2SnHw9kMEs4BxEOWJYGNYkT7KPduqa7sU5qKCslRdUCXfRPGBhOEn/EP6PRQRyFBeOR5 vQAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=pAWemTCXsDJVju4uFNQX+0CArQG8zJrspJ71CshzqJI=; b=cx2zys3FIy79OXSYpccT1jysmmGXp0c0a9pv6B8kQ8FlAXK5nUKo2t6istmbgEpBZ/ oLwYP5jNuayCjxH2GdERoTMDcM+0oFi/jKbYD63S2mHARrmLqzj9tTN+r+Pu4rWNBbzI +4fG9rj+denKctKBORUH7SsErABmrnwGCIrFcCO7QsZpytZV2iU1lCCy6yTKETRUa+5C +BRrPB8T1nNgTeAj7goFc46gajXWxHx8ovB2BeG0rgCiaUNP4+chAQBQ/uhwBgPikhvF G2P1xVCa4tpZNrIfIMR/UswQbo6+2zl3Oy6vznh0CmjDDnYYTsUREwZsj2dYTPykS2Rm GBVg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si3582236edn.579.2020.07.10.02.28.37; Fri, 10 Jul 2020 02:29:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727777AbgGJJ2g (ORCPT + 99 others); Fri, 10 Jul 2020 05:28:36 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55768 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726787AbgGJJ2f (ORCPT ); Fri, 10 Jul 2020 05:28:35 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0DD457E1C9EE707D370B; Fri, 10 Jul 2020 17:28:33 +0800 (CST) Received: from huawei.com (10.175.104.57) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 10 Jul 2020 17:28:26 +0800 From: Lu Wei To: , , , , , , , Subject: [PATCH v3 1/2] intel-hid: Fix return value check in check_acpi_dev() Date: Fri, 10 Jul 2020 17:30:17 +0800 Message-ID: <1594373418-24833-2-git-send-email-luwei32@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594373418-24833-1-git-send-email-luwei32@huawei.com> References: <1594373418-24833-1-git-send-email-luwei32@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.57] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 cc7dd4d..c45250c 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.7.4