netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: David Wilder <wilder@us.ibm.com>, netdev@vger.kernel.org
Cc: jv@jvosburgh.net, pradeep@us.ibm.com, i.maximets@ovn.org,
	amorenoz@redhat.com, haliu@redhat.com,
	stephen@networkplumber.org, horms@kernel.org, kuba@kernel.org,
	andrew+netdev@lunn.ch, edumazet@google.com
Subject: Re: [PATCH net-next v13 5/7] bonding: Update to bond_arp_send_all() to use supplied vlan tags
Date: Thu, 16 Oct 2025 13:38:08 +0200	[thread overview]
Message-ID: <b2526050-acf6-451a-8f0a-17ce1a8261a0@redhat.com> (raw)
In-Reply-To: <20251013235328.1289410-6-wilder@us.ibm.com>

On 10/14/25 1:52 AM, David Wilder wrote:
> @@ -3097,9 +3100,11 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
>  		if (rt->dst.dev == bond->dev)
>  			goto found;
>  
> -		rcu_read_lock();
> -		tags = bond_verify_device_path(bond->dev, rt->dst.dev, 0);
> -		rcu_read_unlock();
> +		if (!tags) {
> +			rcu_read_lock();
> +			tags = bond_verify_device_path(bond->dev, rt->dst.dev, 0);
> +			rcu_read_unlock();
> +		}
>  
>  		if (!IS_ERR_OR_NULL(tags))
>  			goto found;
> @@ -3115,7 +3120,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
>  		addr = bond_confirm_addr(rt->dst.dev, target_ip, 0);
>  		ip_rt_put(rt);
>  		bond_arp_send(slave, ARPOP_REQUEST, target_ip, addr, tags);
> -		kfree(tags);
> +		if  (!(flags & BOND_TARGET_USERTAGS))
> +			kfree(tags);

It's IMHO not obvious from the above code that `tags` is allocated (by
bond_verify_device_path() if and only if !(flags & BOND_TARGET_USERTAGS)

I think it would be more clear if you use the same condition for both
the allocation and the free calls.

/P


  reply	other threads:[~2025-10-16 11:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13 23:52 [PATCH net-next v13 0/7] bonding: Extend arp_ip_target format to allow for a list of vlan tags David Wilder
2025-10-13 23:52 ` [PATCH net-next v13 1/7] bonding: Adding struct bond_arp_target David Wilder
2025-10-13 23:52 ` [PATCH net-next v13 2/7] bonding: Adding extra_len field to struct bond_opt_value David Wilder
2025-10-13 23:52 ` [PATCH net-next v13 3/7] bonding: arp_ip_target helpers David Wilder
2025-10-16 11:14   ` Paolo Abeni
2025-10-13 23:52 ` [PATCH net-next v13 4/7] bonding: Processing extended arp_ip_target from user space David Wilder
2025-10-16 11:26   ` Paolo Abeni
2025-10-13 23:52 ` [PATCH net-next v13 5/7] bonding: Update to bond_arp_send_all() to use supplied vlan tags David Wilder
2025-10-16 11:38   ` Paolo Abeni [this message]
2025-10-13 23:52 ` [PATCH net-next v13 6/7] bonding: Update for extended arp_ip_target format David Wilder
2025-10-16 11:50   ` Paolo Abeni
2025-10-16 19:49     ` Jakub Kicinski
2025-10-17  0:21       ` David Wilder
2025-10-21 16:00         ` David Wilder
2025-10-21 16:18           ` David Wilder
2025-10-21 22:56         ` Jakub Kicinski
2025-10-13 23:52 ` [PATCH net-next v13 7/7] bonding: Selftest and documentation for the arp_ip_target parameter David Wilder
2025-10-16 11:55   ` Paolo Abeni
2025-10-16 11:48 ` [PATCH net-next v13 0/7] bonding: Extend arp_ip_target format to allow for a list of vlan tags Nikolay Aleksandrov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2526050-acf6-451a-8f0a-17ce1a8261a0@redhat.com \
    --to=pabeni@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=edumazet@google.com \
    --cc=haliu@redhat.com \
    --cc=horms@kernel.org \
    --cc=i.maximets@ovn.org \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pradeep@us.ibm.com \
    --cc=stephen@networkplumber.org \
    --cc=wilder@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).