ax25: more common return path joining
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sat, 7 Feb 2009 07:47:14 +0000 (23:47 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Feb 2009 07:47:14 +0000 (23:47 -0800)
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>
net/ax25/ax25_iface.c

index 8443af57a3740253f10ddcf505246165fee5e56a..71338f112108a06ee9b3734d19c7146c54fea7a9 100644 (file)
@@ -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);
 }