On Thu, Jun 27, 2013 at 05:00:04AM +0800, Marek Lindner wrote:
On Thursday, June 27, 2013 01:02:06 Antonio Quartulli wrote:
+static struct batadv_softif_vlan * +batadv_kobj_to_vlan(struct batadv_priv *bat_priv, struct kobject *obj) +{
struct batadv_softif_vlan *vlan;
hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) {
if (vlan->kobj != obj)
continue;
if (!atomic_inc_not_zero(&vlan->refcount))
continue;
return vlan;
}
return NULL;
+}
Aren't we missing a rcu_lock()/rcu_unlock() combo ?
I was unsure of this because of the context where this for_each is executed. But I think there is nothing protecting the RCU..so yes, we need rcu_read_lock/unlock.
Cheers, Marek