Skip to content

Commit

Permalink
[IrDA]: Fix RCU lock pairing on error path
Browse files Browse the repository at this point in the history
irlan_client_discovery_indication calls rcu_read_lock and rcu_read_unlock, but
returns without unlocking in an error case.  Fix that by replacing the return
with a goto so that the rcu_read_unlock always gets executed.

Signed-off-by: Josh Triplett <[email protected]>
Acked-by: Paul E. McKenney <[email protected]>
Signed-off-by: Samuel Ortiz [email protected] <>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
joshtriplett authored and davem330 committed Jun 30, 2006
1 parent 244055f commit 1bc1731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/irda/irlan/irlan_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ void irlan_client_discovery_indication(discinfo_t *discovery,
rcu_read_lock();
self = irlan_get_any();
if (self) {
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, goto out;);

IRDA_DEBUG(1, "%s(), Found instance (%08x)!\n", __FUNCTION__ ,
daddr);

irlan_client_wakeup(self, saddr, daddr);
}
IRDA_ASSERT_LABEL(out:)
rcu_read_unlock();
}

Expand Down

0 comments on commit 1bc1731

Please sign in to comment.