From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbdJKRab (ORCPT ); Wed, 11 Oct 2017 13:30:31 -0400 Received: from mail-qt0-f175.google.com ([209.85.216.175]:52408 "EHLO mail-qt0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147AbdJKRaa (ORCPT ); Wed, 11 Oct 2017 13:30:30 -0400 X-Google-Smtp-Source: AOwi7QBU429LNxRDGPytgsoID8kMP2VLUluWK5UvlDjuc0Q+B3t15nKOzlU04a80ryGDlvGxVqBxzQ== Date: Wed, 11 Oct 2017 13:30:28 -0400 From: Sean Paul To: Wei Yongjun Cc: Xinliang Liu , zourongrong@gmail.com, kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com, airlied@linux.ie, robh@kernel.org, rmk+kernel@armlinux.org.uk, treding@nvidia.com, arnd@arndb.de, daniel.vetter@ffwll.ch, seanpaul@chromium.org, krisman@collabora.co.uk, jsarha@ti.com, noralf@tronnes.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm: Fix return value check in kirin_drm_platform_probe() Message-ID: <20171011173028.lvtwcs7sbc5eqo44@art_vandelay> References: <1507720636-129038-1-git-send-email-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1507720636-129038-1-git-send-email-weiyongjun1@huawei.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 11, 2017 at 11:17:16AM +0000, Wei Yongjun wrote: > 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 Reviewed-by: Sean Paul > --- > 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); > > > -- Sean Paul, Software Engineer, Google / Chromium OS