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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c95f5ff3-8dad-4302-9384-92a9b83f7bdc@web.de>
Date: Mon, 19 Feb 2024 18:48:30 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Johan Hovold <johan+linaro@...nel.org>, freedreno@...ts.freedesktop.org,
 dri-devel@...ts.freedesktop.org, linux-phy@...ts.infradead.org,
 linux-arm-msm@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Andrzej Hajda <andrzej.hajda@...el.com>,
 Bjorn Andersson <andersson@...nel.org>, Daniel Vetter <daniel@...ll.ch>,
 David Airlie <airlied@...il.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>,
 Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
 Thomas Zimmermann <tzimmermann@...e.de>, Vinod Koul <vkoul@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Abhinav Kumar <quic_abhinavk@...cinc.com>,
 Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
 Jernej Skrabec <jernej.skrabec@...il.com>, Jonas Karlman <jonas@...boo.se>,
 Kishon Vijay Abraham I <kishon@...nel.org>,
 Konrad Dybcio <konrad.dybcio@...aro.org>,
 Kuogee Hsieh <quic_khsieh@...cinc.com>,
 Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
 Rob Clark <robdclark@...il.com>
Subject: Re: [PATCH 1/6] drm/bridge: aux-hpd: fix OF node leaks

> The two device node references taken during allocation need to be
> dropped when the auxiliary device is freed.
…
> +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c
…
> @@ -74,6 +75,8 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent,
>
>  	ret = auxiliary_device_init(adev);
>  	if (ret) {
> +		of_node_put(adev->dev.platform_data);
> +		of_node_put(adev->dev.of_node);
>  		ida_free(&drm_aux_hpd_bridge_ida, adev->id);
>  		kfree(adev);
>  		return ERR_PTR(ret);

The last two statements are also used in a previous if branch.
https://elixir.bootlin.com/linux/v6.8-rc5/source/drivers/gpu/drm/bridge/aux-hpd-bridge.c#L63

How do you think about to avoid such a bit of duplicate source code
by adding a label here?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ