提交 1c89a8e3 编写于 作者: A Alexander Aring 提交者: David S. Miller

ieee802154: hwsim: using right kind of iteration

This patch fixes the error path to unsubscribe all other phy's from
current phy. The actually code using a wrong kind of list iteration may
copied from the case to unsubscribe the current phy from all other
phy's.

Cc: Stefan Schmidt <stefan@datenfreihafen.org>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Fixes: f25da51f ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: NAlexander Aring <aring@mojatatu.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ac272a3e
...@@ -735,10 +735,12 @@ static int hwsim_subscribe_all_others(struct hwsim_phy *phy) ...@@ -735,10 +735,12 @@ static int hwsim_subscribe_all_others(struct hwsim_phy *phy)
return 0; return 0;
me_fail: me_fail:
list_for_each_entry(phy, &hwsim_phys, list) { rcu_read_lock();
list_for_each_entry_rcu(e, &phy->edges, list) {
list_del_rcu(&e->list); list_del_rcu(&e->list);
hwsim_free_edge(e); hwsim_free_edge(e);
} }
rcu_read_unlock();
sub_fail: sub_fail:
hwsim_edge_unsubscribe_me(phy); hwsim_edge_unsubscribe_me(phy);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册