From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756575AbdJKLN1 (ORCPT ); Wed, 11 Oct 2017 07:13:27 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7564 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294AbdJKLNZ (ORCPT ); Wed, 11 Oct 2017 07:13:25 -0400 From: Wei Yongjun To: Xinliang Liu , , , , , , , , , , , , , CC: Wei Yongjun , , Subject: [PATCH] drm: Fix return value check in kirin_drm_platform_probe() Date: Wed, 11 Oct 2017 11:17:16 +0000 Message-ID: <1507720636-129038-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59DDFCB7.013E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 26a9bcb19367e06c6074b740fe0f52a2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function of_graph_get_remote_node() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.. Signed-off-by: Wei Yongjun --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index e27352c..527aa58 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -236,8 +236,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev) } remote = of_graph_get_remote_node(np, 0, 0); - if (IS_ERR(remote)) - return PTR_ERR(remote); + if (!remote) + return -ENODEV; drm_of_component_match_add(dev, &match, compare_of, remote); of_node_put(remote);