On 05.12.2010 16:15, Marc Kleine-Budde wrote: > On 12/05/2010 10:54 AM, Michal Sojka wrote:
>> diff --git a/net/can/gw.c b/net/can/gw.c >> index 94ba3f1..7779ca6 100644 >> --- a/net/can/gw.c >> +++ b/net/can/gw.c >> @@ -822,11 +822,14 @@ static int cgw_create_job(struct sk_buff *skb, struct >> nlmsghdr *nlh, >> if (gwj->dst.dev->type != ARPHRD_CAN) >> goto put_src_dst_out; >> >> - spin_lock(&cgw_list_lock); >> >> err = cgw_register_filter(gwj); >> - if (!err) >> - hlist_add_head_rcu(&gwj->list, &cgw_list); >> + if (err) >> + goto put_src_dst_out; >> + >> + spin_lock(&cgw_list_lock); >> + >> + hlist_add_head_rcu(&gwj->list, &cgw_list); >> >> spin_unlock(&cgw_list_lock); > > The fix looks good! At least it fixes the issue, i had in my kernel log ... (in my other post). My problem is, that the notifier in cgw_notifier() expects the registered CAN filter and the hlist entry to be available together. That was the reason, why it put this together in the locked region. Regards, Oliver _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
