From patchwork Thu Nov 10 09:44:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cuigaosheng X-Patchwork-Id: 13038537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16F06C4332F for ; Thu, 10 Nov 2022 09:45:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F2B510E6BA; Thu, 10 Nov 2022 09:45:05 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by gabe.freedesktop.org (Postfix) with ESMTPS id A550110E6AD; Thu, 10 Nov 2022 09:44:52 +0000 (UTC) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4N7H436vQRz15MWQ; Thu, 10 Nov 2022 17:44:35 +0800 (CST) Received: from cgs.huawei.com (10.244.148.83) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 17:44:48 +0800 From: Gaosheng Cui To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 3/5] drm/msm: Fix IS_ERR_OR_NULL() vs NULL check in msm_icc_get() Date: Thu, 10 Nov 2022 17:44:43 +0800 Message-ID: <20221110094445.2930509-4-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110094445.2930509-1-cuigaosheng1@huawei.com> References: <20221110094445.2930509-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The of_icc_get() function returns NULL or error pointers on error path, so we should use IS_ERR_OR_NULL() to check the return value. Fixes: 5ccdcecaf8f7 ("drm/msm: lookup the ICC paths in both mdp5/dpu and mdss devices") Signed-off-by: Gaosheng Cui --- drivers/gpu/drm/msm/msm_io_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c index d02cd29ce829..950083b2f092 100644 --- a/drivers/gpu/drm/msm/msm_io_utils.c +++ b/drivers/gpu/drm/msm/msm_io_utils.c @@ -133,7 +133,7 @@ struct icc_path *msm_icc_get(struct device *dev, const char *name) struct icc_path *path; path = of_icc_get(dev, name); - if (path) + if (IS_ERR_OR_NULL(path)) return path; /*