diff options
Diffstat (limited to 'net/ax25/ax25_iface.c')
| -rw-r--r-- | net/ax25/ax25_iface.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c index 3bb152710b77..07ac0207eb69 100644 --- a/net/ax25/ax25_iface.c +++ b/net/ax25/ax25_iface.c | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) | 7 | * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) |
| 8 | */ | 8 | */ |
| 9 | #include <linux/config.h> | ||
| 10 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
| 11 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 12 | #include <linux/socket.h> | 11 | #include <linux/socket.h> |
| @@ -67,10 +66,10 @@ int ax25_protocol_register(unsigned int pid, | |||
| 67 | protocol->pid = pid; | 66 | protocol->pid = pid; |
| 68 | protocol->func = func; | 67 | protocol->func = func; |
| 69 | 68 | ||
| 70 | write_lock(&protocol_list_lock); | 69 | write_lock_bh(&protocol_list_lock); |
| 71 | protocol->next = protocol_list; | 70 | protocol->next = protocol_list; |
| 72 | protocol_list = protocol; | 71 | protocol_list = protocol; |
| 73 | write_unlock(&protocol_list_lock); | 72 | write_unlock_bh(&protocol_list_lock); |
| 74 | 73 | ||
| 75 | return 1; | 74 | return 1; |
| 76 | } | 75 | } |
| @@ -81,16 +80,16 @@ void ax25_protocol_release(unsigned int pid) | |||
| 81 | { | 80 | { |
| 82 | struct protocol_struct *s, *protocol; | 81 | struct protocol_struct *s, *protocol; |
| 83 | 82 | ||
| 84 | write_lock(&protocol_list_lock); | 83 | write_lock_bh(&protocol_list_lock); |
| 85 | protocol = protocol_list; | 84 | protocol = protocol_list; |
| 86 | if (protocol == NULL) { | 85 | if (protocol == NULL) { |
| 87 | write_unlock(&protocol_list_lock); | 86 | write_unlock_bh(&protocol_list_lock); |
| 88 | return; | 87 | return; |
| 89 | } | 88 | } |
| 90 | 89 | ||
| 91 | if (protocol->pid == pid) { | 90 | if (protocol->pid == pid) { |
| 92 | protocol_list = protocol->next; | 91 | protocol_list = protocol->next; |
| 93 | write_unlock(&protocol_list_lock); | 92 | write_unlock_bh(&protocol_list_lock); |
| 94 | kfree(protocol); | 93 | kfree(protocol); |
| 95 | return; | 94 | return; |
| 96 | } | 95 | } |
| @@ -99,14 +98,14 @@ void ax25_protocol_release(unsigned int pid) | |||
| 99 | if (protocol->next->pid == pid) { | 98 | if (protocol->next->pid == pid) { |
| 100 | s = protocol->next; | 99 | s = protocol->next; |
| 101 | protocol->next = protocol->next->next; | 100 | protocol->next = protocol->next->next; |
| 102 | write_unlock(&protocol_list_lock); | 101 | write_unlock_bh(&protocol_list_lock); |
| 103 | kfree(s); | 102 | kfree(s); |
| 104 | return; | 103 | return; |
| 105 | } | 104 | } |
| 106 | 105 | ||
| 107 | protocol = protocol->next; | 106 | protocol = protocol->next; |
| 108 | } | 107 | } |
| 109 | write_unlock(&protocol_list_lock); | 108 | write_unlock_bh(&protocol_list_lock); |
| 110 | } | 109 | } |
| 111 | 110 | ||
| 112 | EXPORT_SYMBOL(ax25_protocol_release); | 111 | EXPORT_SYMBOL(ax25_protocol_release); |
| @@ -267,13 +266,13 @@ int ax25_protocol_is_registered(unsigned int pid) | |||
| 267 | struct protocol_struct *protocol; | 266 | struct protocol_struct *protocol; |
| 268 | int res = 0; | 267 | int res = 0; |
| 269 | 268 | ||
| 270 | read_lock(&protocol_list_lock); | 269 | read_lock_bh(&protocol_list_lock); |
| 271 | for (protocol = protocol_list; protocol != NULL; protocol = protocol->next) | 270 | for (protocol = protocol_list; protocol != NULL; protocol = protocol->next) |
| 272 | if (protocol->pid == pid) { | 271 | if (protocol->pid == pid) { |
| 273 | res = 1; | 272 | res = 1; |
| 274 | break; | 273 | break; |
| 275 | } | 274 | } |
| 276 | read_unlock(&protocol_list_lock); | 275 | read_unlock_bh(&protocol_list_lock); |
| 277 | 276 | ||
| 278 | return res; | 277 | return res; |
| 279 | } | 278 | } |
