.. | .. |
---|
522 | 522 | static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info) |
---|
523 | 523 | { |
---|
524 | 524 | struct nlattr *edge_attrs[MAC802154_HWSIM_EDGE_ATTR_MAX + 1]; |
---|
525 | | - struct hwsim_edge_info *einfo; |
---|
| 525 | + struct hwsim_edge_info *einfo, *einfo_old; |
---|
526 | 526 | struct hwsim_phy *phy_v0; |
---|
527 | 527 | struct hwsim_edge *e; |
---|
528 | 528 | u32 v0, v1; |
---|
.. | .. |
---|
560 | 560 | list_for_each_entry_rcu(e, &phy_v0->edges, list) { |
---|
561 | 561 | if (e->endpoint->idx == v1) { |
---|
562 | 562 | einfo->lqi = lqi; |
---|
563 | | - rcu_assign_pointer(e->info, einfo); |
---|
| 563 | + einfo_old = rcu_replace_pointer(e->info, einfo, |
---|
| 564 | + lockdep_is_held(&hwsim_phys_lock)); |
---|
564 | 565 | rcu_read_unlock(); |
---|
| 566 | + kfree_rcu(einfo_old, rcu); |
---|
565 | 567 | mutex_unlock(&hwsim_phys_lock); |
---|
566 | 568 | return 0; |
---|
567 | 569 | } |
---|