Skip to contentSkip to conversation

Missing unlocks

B.A.T.M.A.N. Andrew Lunn 2 participants 2 messages Jan 1, 2010

lore
Share & tools
lore
#0 lore raw

Hi Simon

I just built batman-adv with make C=1 so that sparse it used to check the code. It found a few missing unlocks...

drivers/staging/batman-adv/routing.c:585:12: warning: context imbalance in 'recv_my_icmp_packet' - different lock contexts for basic block

This is the return if the skb_copy() fails.

drivers/staging/batman-adv/routing.c:640:12: warning: context imbalance in 'recv_icmp_ttl_exceeded' - different lock contexts for basic block

Same again.

drivers/staging/batman-adv/routing.c:695:5: warning: context imbalance in 'recv_icmp_packet' - different lock contexts for basic block

and same again...

in each case you are missing a

spin_unlock_irqrestore(&orig_hash_lock, flags);

before the

return NET_RX_DROP;

Andrew

#1 lore raw

Hello Andrew,

thank you, i've commited a patch for this in revision 1529. This should fix this bug and make sparse happy. :)

best regards,
Simon

Quoted 27 lines · Andrew Lunn

Hi Simon

I just built batman-adv with make C=1 so that sparse it used to check the code. It found a few missing unlocks...

drivers/staging/batman-adv/routing.c:585:12: warning: context imbalance in 'recv_my_icmp_packet' - different lock contexts for basic block

This is the return if the skb_copy() fails.

drivers/staging/batman-adv/routing.c:640:12: warning: context imbalance in 'recv_icmp_ttl_exceeded' - different lock contexts for basic block

Same again.

drivers/staging/batman-adv/routing.c:695:5: warning: context imbalance in 'recv_icmp_packet' - different lock contexts for basic block

and same again...

in each case you are missing a

spin_unlock_irqrestore(&orig_hash_lock, flags);

before the

return NET_RX_DROP;

Andrew