User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | net/xfrm/xfrm_state.c |
Line in file: | 1604 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Confirmation: | Fixed by 7d0b591c655ca0d72ebcbd242cf659a20a8995c5 |
Tools: |
Stanse
(1.2)
Clang Static Analyzer (3.0) Smatch (1.59) |
Entered: | 2011-11-07 22:19:59 UTC |
1574 } 1575 walk->seq++; 1576 } 1577 if (walk->seq == 0) { 1578 err = -ENOENT; 1579 goto out; 1580 } 1581 list_del_init(&walk->all); 1582out: 1583 spin_unlock_bh(&xfrm_state_lock); 1584 return err; 1585} 1586EXPORT_SYMBOL(xfrm_state_walk); 1587 1588void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto) 1589{ 1590 INIT_LIST_HEAD(&walk->all); 1591 walk->proto = proto; 1592 walk->state = XFRM_STATE_DEAD; 1593 walk->seq = 0; 1594} 1595EXPORT_SYMBOL(xfrm_state_walk_init); 1596 1597void xfrm_state_walk_done(struct xfrm_state_walk *walk) 1598{ 1599 if (list_empty(&walk->all)) 1600 return; 1601 1602 spin_lock_bh(&xfrm_state_lock); 1603 list_del(&walk->all); 1604 spin_lock_bh(&xfrm_state_lock); 1605} 1606EXPORT_SYMBOL(xfrm_state_walk_done); 1607 1608 1609void xfrm_replay_notify(struct xfrm_state *x, int event) 1610{ 1611 struct km_event c; 1612 /* we send notify messages in case 1613 * 1. we updated on of the sequence numbers, and the seqno difference 1614 * is at least x->replay_maxdiff, in this case we also update the