From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BDDE348875 for ; Mon, 25 May 2026 10:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779704079; cv=none; b=PwLu2x4pi5l+MAGCJinLNZT69FvGBjduZGEGGnMZXcEQQemczTgEXaX//KzDKvmoJnJQ6itqnf/x8UGv2Rd32xi6/EdgZlLfmT0rsxohN6/NXr8dldl1SRrxawZAKIltI4deCW0qCIPHX+WsSOMp/+5xontKPDtRpGPoPyq0TYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779704079; c=relaxed/simple; bh=Ipp0kkfthINGpW3s+qD1mOApPHFjk2fjvLSUNv6kR4Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sAYeU1CVYQbNfP1a1GKxgjY5rWX/B2Udd8wlWxsVIoi+MjjGyv384ukN5T8FaXN3o3ntiYVt/VIJ3fdwsHrpKfl3WlpyHAic0eEVOyum5fmxv9i9HBFQTqL0/3V7jKQtVBnZD+GYicRJphXk3Zsh8Y9Eo/bJAnTIp25QgzCdMDE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=NcpNvr/k; arc=none smtp.client-ip=80.12.242.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="NcpNvr/k" Received: from [IPV6:2a01:cb10:785:b00:8347:f260:7456:7662] ([10.64.95.113]) by smtp.orange.fr with ESMTP id RSKMw1KmpI5dgRSKMwQon0; Mon, 25 May 2026 12:14:30 +0200 Received: from [IPV6:2a01:cb10:785:b00:8347:f260:7456:7662] ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPSA id RSKCwSmE60vWHRSKCwRtyp; Mon, 25 May 2026 12:14:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1779704063; bh=RHF5/7UJVhD27Lwb3tHM9Ryg0OTUsaGFuxHHVJkuPxk=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=NcpNvr/k0+PeOZaoW4Nk+Iybpzmi6ytDHvD3XA9jydeEmW1P78wZ0USD+CLdeAkuk ai4y2JPxyZaViQI8SK+BkPTe4+ykrdzO1mTOrZ5qGqe4hUHCVgq4Q0b2u7P5iIcGuj rVLOQ8OZcaOYRJ5f1yhHkKFQskNW47SimzDKmBXgFwy4yFqQKG4JA/2NcwFz7WnrKj Yxr3iCo2J4Mrnwr373rlBZWNMWbbe0z6p5R/QC+dTybMbizogzsDRkb2DpoPQWJPTR WYBs8pEp0/Q28im+9cWb764Z3e6YEUsCti2zPMKtIoh9qS4WkT5JCMLV/g22LGGBQ6 ZZ3CbCAMRr5Pg== X-ME-Helo: [IPV6:2a01:cb10:785:b00:8347:f260:7456:7662] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 25 May 2026 12:14:23 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 Message-ID: Date: Mon, 25 May 2026 12:14:18 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] drm/panel: novatek-nt36523: use devm_drm_panel_add() To: Myeonghun Pak , Neil Armstrong Cc: Jianhua Lu , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ijae Kim References: Content-Language: en-US, fr-FR From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 24/05/2026 à 18:36, Myeonghun Pak a écrit : > nt36523_probe() adds the DRM panel before attaching the DSI devices. If > one of the devm_mipi_dsi_attach() calls fails, probe returns with the > panel still registered. > > This issue was identified during our ongoing static-analysis research while > reviewing kernel code. > > Fixes: 0993234a0045 ("drm/panel: Add driver for Novatek NT36523") > Cc: stable@vger.kernel.org > Co-developed-by: Ijae Kim > Signed-off-by: Ijae Kim > Signed-off-by: Myeonghun Pak > --- > drivers/gpu/drm/panel/panel-novatek-nt36523.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c > index 226d91daf8..f6592b01df 100644 > --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c > +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c > @@ -1047,13 +1047,6 @@ static int nt36523_unprepare(struct drm_panel *panel) > return 0; > } > > -static void nt36523_remove(struct mipi_dsi_device *dsi) > -{ > - struct panel_info *pinfo = mipi_dsi_get_drvdata(dsi); Hi, Not looked in details, but the: mipi_dsi_set_drvdata(dsi, pinfo); in the probe now looks useless. CJ > - > - drm_panel_remove(&pinfo->panel); > -} > - > static int nt36523_get_modes(struct drm_panel *panel, > struct drm_connector *connector) > { > @@ -1225,7 +1218,9 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) > return dev_err_probe(dev, ret, "Failed to get backlight\n"); > } > > - drm_panel_add(&pinfo->panel); > + ret = devm_drm_panel_add(dev, &pinfo->panel); > + if (ret) > + return ret; > > for (i = 0; i < DSI_NUM_MIN + pinfo->desc->is_dual_dsi; i++) { > pinfo->dsi[i]->lanes = pinfo->desc->lanes; > @@ -1259,7 +1254,6 @@ MODULE_DEVICE_TABLE(of, nt36523_of_match); > > static struct mipi_dsi_driver nt36523_driver = { > .probe = nt36523_probe, > - .remove = nt36523_remove, > .driver = { > .name = "panel-novatek-nt36523", > .of_match_table = nt36523_of_match,