lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DG6WQ5F88DOH.1ITTFO6WDJ4AS@bootlin.com>
Date: Thu, 05 Feb 2026 10:06:09 +0100
From: "Luca Ceresoli" <luca.ceresoli@...tlin.com>
To: "Chen Ni" <nichen@...as.ac.cn>, <andyshrk@....com>,
 <Laurent.pinchart@...asonboard.com>, <airlied@...il.com>,
 <andrzej.hajda@...el.com>, <andy.yan@...k-chips.com>,
 <jernej.skrabec@...il.com>, <jonas@...boo.se>,
 <maarten.lankhorst@...ux.intel.com>, <mripard@...nel.org>,
 <neil.armstrong@...aro.org>, <rfoss@...nel.org>, <rgallaispou@...il.com>,
 <simona@...ll.ch>, <tzimmermann@...e.de>
Cc: <dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] drm/bridge: synopsys: dw-dp: Check return value of
 devm_drm_bridge_add() in dw_dp_bind()

On Wed Feb 4, 2026 at 10:21 AM CET, Chen Ni wrote:
> Return the value of devm_drm_bridge_add() in order to propagate the
> error properly, if it fails due to resource allocation failure or bridge
> registration failure.
>
> This ensures that the bind function fails safely rather than proceeding
> with a potentially incomplete bridge setup.
>
> Fixes: b726970486d8 ("drm/bridge: synopsys: dw-dp: add bridge before attaching")
> Signed-off-by: Chen Ni <nichen@...as.ac.cn>

Ah, good catch, thanks for the patch!

> ---
> Changes in v2:
> - Use ERR_PTR() instead of dev_err_ptr_probe().
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-dp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> index 432342452484..29fcba7a47d3 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> @@ -2049,7 +2049,11 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
>  	bridge->type = DRM_MODE_CONNECTOR_DisplayPort;
>  	bridge->ycbcr_420_allowed = true;
>
> -	devm_drm_bridge_add(dev, bridge);
> +	ret = devm_drm_bridge_add(dev, bridge);
> +	if (ret) {
> +		dev_err_probe(dev, ret, "failed to add bridge\n");
> +		return ERR_PTR(ret);
> +	}

Looks correct, but can be simpler:

	ret = devm_drm_bridge_add(dev, bridge);
	if (ret)
		return ERR_PTR(dev_err_probe(dev, ret, "failed to add bridge\n"));

Also, when sending a new iteration, it is common to _not_ send the patch as
a reply to the previous iteration. It can generate huge threads for long
series. Also I'd not be surprised if it confused some tools, even though I
just did a quick test with b4 and it seems to do the expected thing (take
v2, not v1).

Best regards,
Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ