Re: [PATCH net v3 2/2] ax25: Change kfree() in ax25_dev_free() to ax25_dev_put()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



…
> 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





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux