From patchwork Mon Jan 15 10:41:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 10163559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7C3F60467 for ; Mon, 15 Jan 2018 10:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC56F287EA for ; Mon, 15 Jan 2018 10:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A11BA2886F; Mon, 15 Jan 2018 10:40:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 32554287B6 for ; Mon, 15 Jan 2018 10:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ISLdaKOSbPGDr1OLed3Ug7b6LH1QHgs9ygDXU9xRYns=; b=KPvVmOu6aC/yUC 8P3+6HTbpndWVxtMMLef7guCbhh2c28nNdSWL155eh4/TQz0R1B/2UUa4crYyN7+btftrFcQ6M/Vx EmEl/Uu4FRFSiKORbZaez+z+NslB8dJ192s+jFXv/QJUK0971Pr9a5yEYkJMc+1MeYlqiTEcEwBy6 U8Q4xYfCh02Y0hVMwMvA9dVdQC/tDZEaV4qFa2iY5ULlDVMIr0nRVKv1ZBqs1QRufGIT7eGYZXrWu iMgtxz9DYuBX60EhRzQ/xrHvtSISS89g+A0+t1pQ5ed6wtTnJDkpxZDgxrVnINagR/Aj1jrnnqm1G TerDfiDANr0VZ6aR/etQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eb2CD-0005rd-73; Mon, 15 Jan 2018 10:40:53 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eb27z-0000Q8-7H for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Jan 2018 10:36:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kjOVtpGIA1enUlX25vDMaPoG+uchqEqbuQH2YPOhwAs=; b=Q8X5eAyj1PpZPJT8/7BypMqCTB yqQ88hGjELYpUE4qCJ3jmzPa0RskRgq0b9RuCxfjlQJIWnUe1tbWUIE9fOfSUDe4L+CV3tu50ZeUy pHB4YAoOXTpptz+Hz0wZvu90CRmXguYPLwpgi+29pBtm+XdyowZMwIgb/lK3LeSs/2iJ13d6DHsj4 Q0+2CRqGi0iEzJSU5GYaCxfWQ+wT5HhbHAeZfaZxb2nVAhppuIa4w2QOqLUsEjOVmqJeSqrJkS7pv RJRZ/FX7SJoJfr/XMvSr3LJmg4aAah3XZFP+B3aH/jxz9sjLbTaQMkx6QbofcgFczNbbNA7TkuRvb RUuvjyRQ==; Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eb27v-0007uy-Ml for linux-arm-kernel@lists.infradead.org; Mon, 15 Jan 2018 10:36:28 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 957B51D711B6D; Mon, 15 Jan 2018 18:35:47 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Mon, 15 Jan 2018 18:35:39 +0800 From: Wei Yongjun To: James Morse , Catalin Marinas Subject: [PATCH -next] firmware: arm_sdei: Fix return value check in sdei_present_dt() Date: Mon, 15 Jan 2018 10:41:53 +0000 Message-ID: <1516012913-196560-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In case of error, the function of_platform_device_create() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 677a60bd2003 ("firmware: arm_sdei: Discover SDEI support via ACPI") Signed-off-by: Wei Yongjun Acked-by: James Morse --- drivers/firmware/arm_sdei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index 8f6563c..1ea7164 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -1023,7 +1023,7 @@ static bool __init sdei_present_dt(void) pdev = of_platform_device_create(np, sdei_driver.driver.name, NULL); of_node_put(np); - if (IS_ERR(pdev)) + if (!pdev) return false; return true;