* [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles()
@ 2025-02-12 10:31 Luca Ceresoli
2025-02-12 10:39 ` Greg Kroah-Hartman
2025-02-13 8:11 ` Saravana Kannan
0 siblings, 2 replies; 4+ messages in thread
From: Luca Ceresoli @ 2025-02-12 10:31 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Saravana Kannan
Cc: Thomas Petazzoni, Hervé Codina, linux-kernel, 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().
Link: https://lore.kernel.org/all/20241204124826.2e055091@booty/
Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
Signed-off-by: Luca Ceresoli <luca.ceresoli@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] 4+ messages in thread
* Re: [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles()
2025-02-12 10:31 [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles() Luca Ceresoli
@ 2025-02-12 10:39 ` Greg Kroah-Hartman
2025-02-13 8:11 ` Saravana Kannan
1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-02-12 10:39 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Rafael J. Wysocki, Danilo Krummrich, Saravana Kannan,
Thomas Petazzoni, Hervé Codina, linux-kernel
On Wed, Feb 12, 2025 at 11:31:34AM +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().
>
> Link: https://lore.kernel.org/all/20241204124826.2e055091@booty/
> Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
> Signed-off-by: Luca Ceresoli <luca.ceresoli@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>
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- You have marked a patch with a "Fixes:" tag for a commit that is in an
older released kernel, yet you do not have a cc: stable line in the
signed-off-by area at all, which means that the patch will not be
applied to any older kernel releases. To properly fix this, please
follow the documented rules in the
Documentation/process/stable-kernel-rules.rst file for how to resolve
this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles()
2025-02-12 10:31 [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles() Luca Ceresoli
2025-02-12 10:39 ` Greg Kroah-Hartman
@ 2025-02-13 8:11 ` Saravana Kannan
2025-02-13 14:02 ` Luca Ceresoli
1 sibling, 1 reply; 4+ messages in thread
From: Saravana Kannan @ 2025-02-13 8:11 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Thomas Petazzoni, Hervé Codina, linux-kernel
On Wed, Feb 12, 2025 at 2:31 AM Luca Ceresoli <luca.ceresoli@bootlin.com> 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().
Thanks for debugging this and fixing it! Glad to see more people
fixing fw_devlink code :)
> Link: https://lore.kernel.org/all/20241204124826.2e055091@booty/
Use the Closes: tag for this link. That tag is used to point to the
bug report that this patch is fixing.
> Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
> Signed-off-by: Luca Ceresoli <luca.ceresoli@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;
> }
Reviewed-by: Saravana Kannan <saravanak@google.com>
Thanks,
Saravana
>
> ---
> 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 [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles()
2025-02-13 8:11 ` Saravana Kannan
@ 2025-02-13 14:02 ` Luca Ceresoli
0 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2025-02-13 14:02 UTC (permalink / raw)
To: Saravana Kannan
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Thomas Petazzoni, Hervé Codina, linux-kernel
Hi Saravana,
On Thu, 13 Feb 2025 00:11:31 -0800
Saravana Kannan <saravanak@google.com> wrote:
> On Wed, Feb 12, 2025 at 2:31 AM Luca Ceresoli <luca.ceresoli@bootlin.com> 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().
>
> Thanks for debugging this and fixing it! Glad to see more people
> fixing fw_devlink code :)
>
> > Link: https://lore.kernel.org/all/20241204124826.2e055091@booty/
> Use the Closes: tag for this link. That tag is used to point to the
> bug report that this patch is fixing.
Good point! Sending v2 with Closes: tag and Cc: stable.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-13 14:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 10:31 [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles() Luca Ceresoli
2025-02-12 10:39 ` Greg Kroah-Hartman
2025-02-13 8:11 ` Saravana Kannan
2025-02-13 14:02 ` Luca Ceresoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox