From nobody Fri Sep 19 08:40:18 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBE3DC46467 for ; Sat, 26 Nov 2022 01:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiKZB7o (ORCPT ); Fri, 25 Nov 2022 20:59:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbiKZB7m (ORCPT ); Fri, 25 Nov 2022 20:59:42 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691DA2CE23 for ; Fri, 25 Nov 2022 17:59:40 -0800 (PST) Received: from kwepemi500015.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NJvzX5nQRzRpSh; Sat, 26 Nov 2022 09:59:04 +0800 (CST) Received: from huawei.com (10.175.101.6) by kwepemi500015.china.huawei.com (7.221.188.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 26 Nov 2022 09:59:38 +0800 From: Lu Wei To: , , , , , , , Subject: [PATCH RESEND net] drm/panel: Fix return value check in nt35950_probe() Date: Sat, 26 Nov 2022 11:04:15 +0800 Message-ID: <20221126030415.4177465-1-luwei32@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500015.china.huawei.com (7.221.188.92) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In function nt35950_probe(), mipi_dsi_device_register_full() is called to create a MIPI DSI device. If it fails, a pointer encoded with an error will be returned, so use IS_ERR() to check the return value. Besides, use PTR_ERR to return the actual errno. Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverI= C panels") Signed-off-by: Lu Wei Acked-by: Sam Ravnborg Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/panel/panel-novatek-nt35950.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/dr= m/panel/panel-novatek-nt35950.c index 3a844917da07..d850b081fd72 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c @@ -579,9 +579,9 @@ static int nt35950_probe(struct mipi_dsi_device *dsi) } =20 nt->dsi[1] =3D mipi_dsi_device_register_full(dsi_r_host, info); - if (!nt->dsi[1]) { + if (IS_ERR(nt->dsi[1])) { dev_err(dev, "Cannot get secondary DSI node\n"); - return -ENODEV; + return PTR_ERR(nt->dsi[1]); } num_dsis++; } --=20 2.31.1