mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
ax25: more common return path joining
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>
This commit is contained in:
parent
69ebbf58f3
commit
910d30b704
1 changed files with 5 additions and 8 deletions
|
@ -61,27 +61,24 @@ void ax25_protocol_release(unsigned int pid)
|
||||||
|
|
||||||
write_lock_bh(&protocol_list_lock);
|
write_lock_bh(&protocol_list_lock);
|
||||||
protocol = protocol_list;
|
protocol = protocol_list;
|
||||||
if (protocol == NULL) {
|
if (protocol == NULL)
|
||||||
write_unlock_bh(&protocol_list_lock);
|
goto out;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (protocol->pid == pid) {
|
if (protocol->pid == pid) {
|
||||||
protocol_list = protocol->next;
|
protocol_list = protocol->next;
|
||||||
write_unlock_bh(&protocol_list_lock);
|
goto out;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (protocol != NULL && protocol->next != NULL) {
|
while (protocol != NULL && protocol->next != NULL) {
|
||||||
if (protocol->next->pid == pid) {
|
if (protocol->next->pid == pid) {
|
||||||
s = protocol->next;
|
s = protocol->next;
|
||||||
protocol->next = protocol->next->next;
|
protocol->next = protocol->next->next;
|
||||||
write_unlock_bh(&protocol_list_lock);
|
goto out;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol = protocol->next;
|
protocol = protocol->next;
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
write_unlock_bh(&protocol_list_lock);
|
write_unlock_bh(&protocol_list_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue