Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp391323ybt; Fri, 10 Jul 2020 02:30:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWWHOr1ehYNBsOf5tNcxfdGbuYeNP42Mmyl72joIBeNxp5yfYjVVI0hKjYL9L3CSd0wTsB X-Received: by 2002:a17:906:c155:: with SMTP id dp21mr57908077ejc.92.1594373457375; Fri, 10 Jul 2020 02:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594373457; cv=none; d=google.com; s=arc-20160816; b=CYL4Xt+IcZ9QgfxUJOZC2gNYVxH1yjsCaytZcZFIVq2iH7tZXXMD8H8fHxac9t82ub /6gszBjAbUDmNvhmY5JRLV08PtckPIsq3gDqo24HN4jYFepxP4qBN9b72JGC+MfmiOVU qZBOxliCizfKUW4kVmuKfVXsFOIqAKdVkqTVocRZwGtFgtrm+phGKKVm2aalT/7sA730 x3oxPvBiN8xf83SmG+talRkwGRKwqhh2dM18Y97MjfYZRNPb7aEsIumTZNCreK7Vd7Op JE1Dit1fsYEX7Axfz3YX/HY1RjSMcnCBf8C4sToL539PLD0w8+8NFwTnz+wx2I+9ycg8 dFAA== 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=3wBoaB6S1i73XyNpulQqgRyHf0wPLO9S7PpzalCLoxM=; b=KwiROp0gkufC4HBUbPfUpSofK1+dHlqWl3W3Zd2DY0L3yxQW4KGoCl9z3vx9oMJqiT EdAdSe3Y0Xu8y2gzxMteZD0lzbT4KpLdE/aGr6qX6Sr9lTJjDN1FkSb4XcJV+e24fIct VdykmJkS6z5h+/nvvAID2hxXNgJg1/1jXnsvEgYY9g9jdK/aBBskSFBVkyOW/kJugzhi Hl+AelBaxxxz2NqlKDLhu6VyiXgC3PwPDBaG/uXODXoAfo1tgUEkeotuPa+a537rxDqD cbLS+grPT4yxHCmhxFaShI2HhcKhbSNhD6b3ybT7y7N9+Y8/UyXlNM3eMvBDgTs2xhd4 dp1w== 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 l17si3777223ejc.174.2020.07.10.02.30.34; Fri, 10 Jul 2020 02:30:57 -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 S1728054AbgGJJ2l (ORCPT + 99 others); Fri, 10 Jul 2020 05:28:41 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7833 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726787AbgGJJ2k (ORCPT ); Fri, 10 Jul 2020 05:28:40 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2DF51369B60CD5918C10; Fri, 10 Jul 2020 17:28:38 +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:27 +0800 From: Lu Wei To: , , , , , , , Subject: [PATCH v3 2/2] intel-vbtn: Fix return value check in check_acpi_dev() Date: Fri, 10 Jul 2020 17:30:18 +0800 Message-ID: <1594373418-24833-3-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: 332e081225fc ("intel-vbtn: new driver for Intel Virtual Button") Reported-by: Hulk Robot Signed-off-by: Lu Wei --- 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 b588093..e1aa526 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -251,7 +251,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.7.4