* [PATCH] netdevice: Add missing parentheses in macro
@ 2015-01-14 7:52 Benjamin Poirier
2015-01-14 21:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Poirier @ 2015-01-14 7:52 UTC (permalink / raw)
To: David S. Miller; +Cc: Nikolay Aleksandrov, netdev, linux-kernel
For example, one could conceivably call
for_each_netdev_in_bond_rcu(condition ? bond1 : bond2, slave)
and get an unexpected result.
Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 7f794db..52fd8e8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2085,7 +2085,7 @@ extern rwlock_t dev_base_lock; /* Device list lock */
list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
#define for_each_netdev_in_bond_rcu(bond, slave) \
for_each_netdev_rcu(&init_net, slave) \
- if (netdev_master_upper_dev_get_rcu(slave) == bond)
+ if (netdev_master_upper_dev_get_rcu(slave) == (bond))
#define net_device_entry(lh) list_entry(lh, struct net_device, dev_list)
static inline struct net_device *next_net_device(struct net_device *dev)
--
2.2.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netdevice: Add missing parentheses in macro
2015-01-14 7:52 [PATCH] netdevice: Add missing parentheses in macro Benjamin Poirier
@ 2015-01-14 21:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-01-14 21:34 UTC (permalink / raw)
To: bpoirier; +Cc: nikolay, netdev, linux-kernel
From: Benjamin Poirier <bpoirier@suse.de>
Date: Wed, 14 Jan 2015 16:52:35 +0900
> For example, one could conceivably call
> for_each_netdev_in_bond_rcu(condition ? bond1 : bond2, slave)
> and get an unexpected result.
>
> Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-14 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-14 7:52 [PATCH] netdevice: Add missing parentheses in macro Benjamin Poirier
2015-01-14 21:34 ` David Miller
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).