Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp377469ybt; Fri, 10 Jul 2020 02:06:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmI3cv6N+Q/cISZ/EQ87kEe1ZM0EcUyu7jVXoDvlckRilOakoCv3P5ve3vM90HPhAu9CfR X-Received: by 2002:a05:6402:a43:: with SMTP id bt3mr64834124edb.332.1594371972388; Fri, 10 Jul 2020 02:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594371972; cv=none; d=google.com; s=arc-20160816; b=SDi+NTdUjrXmri0WcuVR4k46GPCedjS7as+fA9wMkUuLSRqfjB3PLZVojkN1jIMPa3 pDAkfF6hnz8n1FnbqrgIt7kk4Kuk7xTJ5f+3bNvP+BHrogGBcVQXgK4WjtGU8Is1OZi/ 5LQCiRzXqa4Hfqc1xKIjzZ7FxlX/IZ4lBTVetWGM4sjHTliD/FrYoKg1UiFolwt7knpG Q8c0U2gaNgZedeaCALt9Fwh5848/91m85dHrNcpGFGzvQToouxFr5BzkcZQnDp+7Lszx ZNMZYi8vDrWVkSt1dUfOLx1V1kMYfgOy2mpYQ2gWHx4piqnwifa/+tZtcpjPwzYsg/cA lmKQ== 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=TaUe/Fo+jp5MIYX9gkKGtKJJe+oj3PeavHk52Tpo1sw=; b=JbPXQ3lktkxmExGcLWk+QANicU8kCOwwD7VL/aP3Qp4mePseVsAlYufYhBKsT3is/j mm/avWnA1PeZbIFSx1PentHlmXUW9Rumln3XGYc5R94Lpb/MhMF1pD7O7pc5ojmHFyhv lE30xvaJu5hYUGidtiQUx11GsVGdaErK+J0cGsbInSnO8qPITjq5qJuM2m0hdC4dqfvP qQE9Odpx7FgfABpRXZFlFjp1D9G17OY1AuV9X/KWo27BTMxC6MSb6x7DtdnZ12yuO2Dz W83oDm3P3rVtsYgdHl0XvpVt8U4ixmrcwhBGS2Ol790JbA2u1US7gvAsE7W4mPdkWBiS 96hg== 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 bw19si3479182ejb.729.2020.07.10.02.05.49; Fri, 10 Jul 2020 02:06:12 -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 S1727097AbgGJJFi (ORCPT + 99 others); Fri, 10 Jul 2020 05:05:38 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7290 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726496AbgGJJFi (ORCPT ); Fri, 10 Jul 2020 05:05:38 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7670EF0BE4FE5E3372A5; Fri, 10 Jul 2020 17:02:41 +0800 (CST) Received: from huawei.com (10.175.104.57) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 10 Jul 2020 17:02:32 +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:04:23 +0800 Message-ID: <1594371863-20827-3-git-send-email-luwei32@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594371863-20827-1-git-send-email-luwei32@huawei.com> References: <1594371863-20827-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: 332e0812 ("intel-vbtn: new driver for Intel Virtual Button") Reported-by: Hulk Robot Signed-off-by: Lu Wei --- v2->v3 - Modify format 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