* [PATCH RESEND v2] drivers: core: fix device leak in __fw_devlink_relax_cycles()
@ 2025-03-03 9:30 Luca Ceresoli
2025-03-03 14:07 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Luca Ceresoli @ 2025-03-03 9:30 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Saravana Kannan
Cc: Thomas Petazzoni, Hervé Codina, linux-kernel, Andrew Morton,
stable, Luca Ceresoli
Commit bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize
cycle detection logic") introduced a new struct device *con_dev and a
get_dev_from_fwnode() call to get it, but without adding a corresponding
put_device().
Closes: https://lore.kernel.org/all/20241204124826.2e055091@booty/
Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
Cc: stable@vger.kernel.org
Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- add 'Cc: stable@vger.kernel.org'
- use Closes: tag, not Link:
- Link to v1: https://lore.kernel.org/r/20250212-fix__fw_devlink_relax_cycles_missing_device_put-v1-1-41818c7d7722@bootlin.com
---
drivers/base/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 5a1f051981149dc5b5eee4fb69c0ab748a85956d..2fde698430dff98b5e30f7be7d43d310289c4217 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2079,6 +2079,7 @@ static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
out:
sup_handle->flags &= ~FWNODE_FLAG_VISITED;
put_device(sup_dev);
+ put_device(con_dev);
put_device(par_dev);
return ret;
}
---
base-commit: 09fbf3d502050282bf47ab3babe1d4ed54dd1fd8
change-id: 20250212-fix__fw_devlink_relax_cycles_missing_device_put-37cae5f4aac0
Best regards,
--
Luca Ceresoli <luca.ceresoli@bootlin.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH RESEND v2] drivers: core: fix device leak in __fw_devlink_relax_cycles()
2025-03-03 9:30 [PATCH RESEND v2] drivers: core: fix device leak in __fw_devlink_relax_cycles() Luca Ceresoli
@ 2025-03-03 14:07 ` Greg Kroah-Hartman
2025-03-05 8:07 ` Luca Ceresoli
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-03 14:07 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Rafael J. Wysocki, Danilo Krummrich, Saravana Kannan,
Thomas Petazzoni, Hervé Codina, linux-kernel, Andrew Morton,
stable
On Mon, Mar 03, 2025 at 10:30:51AM +0100, Luca Ceresoli wrote:
> Commit bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize
> cycle detection logic") introduced a new struct device *con_dev and a
> get_dev_from_fwnode() call to get it, but without adding a corresponding
> put_device().
>
> Closes: https://lore.kernel.org/all/20241204124826.2e055091@booty/
> Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
> Cc: stable@vger.kernel.org
> Reviewed-by: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
> Changes in v2:
> - add 'Cc: stable@vger.kernel.org'
> - use Closes: tag, not Link:
> - Link to v1: https://lore.kernel.org/r/20250212-fix__fw_devlink_relax_cycles_missing_device_put-v1-1-41818c7d7722@bootlin.com
> ---
> drivers/base/core.c | 1 +
> 1 file changed, 1 insertion(+)
This was applied to my tree on Feb 20, right? Or is this a new version?
Why was it resent?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH RESEND v2] drivers: core: fix device leak in __fw_devlink_relax_cycles()
2025-03-03 14:07 ` Greg Kroah-Hartman
@ 2025-03-05 8:07 ` Luca Ceresoli
0 siblings, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2025-03-05 8:07 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Rafael J. Wysocki, Danilo Krummrich, Saravana Kannan,
Thomas Petazzoni, Hervé Codina, linux-kernel, Andrew Morton,
stable
Hello Greg,
On Mon, 3 Mar 2025 15:07:53 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Mon, Mar 03, 2025 at 10:30:51AM +0100, Luca Ceresoli wrote:
> > Commit bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize
> > cycle detection logic") introduced a new struct device *con_dev and a
> > get_dev_from_fwnode() call to get it, but without adding a corresponding
> > put_device().
> >
> > Closes: https://lore.kernel.org/all/20241204124826.2e055091@booty/
> > Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
> > Cc: stable@vger.kernel.org
> > Reviewed-by: Saravana Kannan <saravanak@google.com>
> > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > ---
> > Changes in v2:
> > - add 'Cc: stable@vger.kernel.org'
> > - use Closes: tag, not Link:
> > - Link to v1: https://lore.kernel.org/r/20250212-fix__fw_devlink_relax_cycles_missing_device_put-v1-1-41818c7d7722@bootlin.com
> > ---
> > drivers/base/core.c | 1 +
> > 1 file changed, 1 insertion(+)
>
> This was applied to my tree on Feb 20, right? Or is this a new version?
> Why was it resent?
I just didn't know it got applied, sorry for the noise. Being a fix, I
was expecting to see it in current master where but it isn't there yet.
Assuming it will be soon, you can ignore it.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-05 8:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 9:30 [PATCH RESEND v2] drivers: core: fix device leak in __fw_devlink_relax_cycles() Luca Ceresoli
2025-03-03 14:07 ` Greg Kroah-Hartman
2025-03-05 8:07 ` Luca Ceresoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox