Skip to content

Commit

Permalink
ax25: more common return path joining
Browse files Browse the repository at this point in the history
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Feb 7, 2009
1 parent 69ebbf5 commit 910d30b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions net/ax25/ax25_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,24 @@ void ax25_protocol_release(unsigned int pid)

write_lock_bh(&protocol_list_lock);
protocol = protocol_list;
if (protocol == NULL) {
write_unlock_bh(&protocol_list_lock);
return;
}
if (protocol == NULL)
goto out;

if (protocol->pid == pid) {
protocol_list = protocol->next;
write_unlock_bh(&protocol_list_lock);
return;
goto out;
}

while (protocol != NULL && protocol->next != NULL) {
if (protocol->next->pid == pid) {
s = protocol->next;
protocol->next = protocol->next->next;
write_unlock_bh(&protocol_list_lock);
return;
goto out;
}

protocol = protocol->next;
}
out:
write_unlock_bh(&protocol_list_lock);
}

Expand Down

0 comments on commit 910d30b

Please sign in to comment.