kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH net v3 1/2] ax25: Fix reference count leak issues of ax25_dev and net_device
       [not found] ` <8338a74098bc1aafbca14d4612a10d6930fcef1b.1715002910.git.duoming@zju.edu.cn>
@ 2024-05-06 15:11   ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2024-05-06 15:11 UTC (permalink / raw)
  To: Dan Carpenter, Duoming Zhou, linux-hams, netdev, kernel-janitors
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Jörg Reuter,
	Paolo Abeni, LKML, Lars Kellogg-Stedman, Simon Horman

> The ax25_addr_ax25dev() exists a reference count leak issue of the
> object "ax25_dev" and the ax25_dev_device_down() exists reference
> count leak issues of the objects "ax25_dev" and "net_device".

I find that such a wording for the introduction of adjustments needs
further improvements.

How do you think about to offer changes for the affected two function
implementations as separate update steps?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.9-rc7#n81

Regards,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net v3 2/2] ax25: Change kfree() in ax25_dev_free() to ax25_dev_put()
       [not found] ` <53925353450dea9a705d67ad225b589e8508042c.1715002910.git.duoming@zju.edu.cn>
@ 2024-05-06 15:50   ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2024-05-06 15:50 UTC (permalink / raw)
  To: Dan Carpenter, Duoming Zhou, linux-hams, netdev, kernel-janitors
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Jörg Reuter,
	Paolo Abeni, LKML, Lars Kellogg-Stedman, Simon Horman

…
> Replace it with a ax25_dev_put() call instead.
> ---
> Changes in v3:
>   - Make commit messages more clearer.
> +++ b/net/ax25/ax25_dev.c
> @@ -188,16 +188,13 @@ struct net_device *ax25_fwd_dev(struct net_device *dev)
>   */
>  void __exit ax25_dev_free(void)
>  {
> -	ax25_dev = ax25_dev_list;
> -	while (ax25_dev != NULL) {
> -		s        = ax25_dev;
> -		netdev_put(ax25_dev->dev, &ax25_dev->dev_tracker);
> -		ax25_dev = ax25_dev->next;
> -		kfree(s);
> +	list_for_each_entry_safe(s, n, &ax25_dev_list, list) {
> +		netdev_put(s->dev, &s->dev_tracker);
> +		list_del(&s->list);
> +		ax25_dev_put(s);
>  	}
> -	ax25_dev_list = NULL;
…

Can the increased application of the Linux list API be offered as
a separate update step?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.9-rc7#n81

Regards,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-06 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1715002910.git.duoming@zju.edu.cn>
     [not found] ` <8338a74098bc1aafbca14d4612a10d6930fcef1b.1715002910.git.duoming@zju.edu.cn>
2024-05-06 15:11   ` [PATCH net v3 1/2] ax25: Fix reference count leak issues of ax25_dev and net_device Markus Elfring
     [not found] ` <53925353450dea9a705d67ad225b589e8508042c.1715002910.git.duoming@zju.edu.cn>
2024-05-06 15:50   ` [PATCH net v3 2/2] ax25: Change kfree() in ax25_dev_free() to ax25_dev_put() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).