diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-09-06 18:49:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-06 18:49:39 -0400 |
commit | f75268cd6cbd24e6c70ff1390f4de5d0bb618539 (patch) | |
tree | ade569781c444bd7f0d648a38cab205d7624e286 /net/netrom | |
parent | f2c383988d68c91a7d474b7cf26c0a2df49bbafe (diff) |
[AX25]: Make ax2asc thread-proof
Ax2asc was still using a static buffer for all invocations which isn't
exactly SMP-safe. Change ax2asc to take an additional result buffer as
the argument. Change all callers to provide such a buffer.
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netrom')
-rw-r--r-- | net/netrom/af_netrom.c | 7 | ||||
-rw-r--r-- | net/netrom/nr_route.c | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 4b53de982114..f4578c759ffc 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1261,6 +1261,7 @@ static int nr_info_show(struct seq_file *seq, void *v) | |||
1261 | struct net_device *dev; | 1261 | struct net_device *dev; |
1262 | struct nr_sock *nr; | 1262 | struct nr_sock *nr; |
1263 | const char *devname; | 1263 | const char *devname; |
1264 | char buf[11]; | ||
1264 | 1265 | ||
1265 | if (v == SEQ_START_TOKEN) | 1266 | if (v == SEQ_START_TOKEN) |
1266 | seq_puts(seq, | 1267 | seq_puts(seq, |
@@ -1276,11 +1277,11 @@ static int nr_info_show(struct seq_file *seq, void *v) | |||
1276 | else | 1277 | else |
1277 | devname = dev->name; | 1278 | devname = dev->name; |
1278 | 1279 | ||
1279 | seq_printf(seq, "%-9s ", ax2asc(&nr->user_addr)); | 1280 | seq_printf(seq, "%-9s ", ax2asc(buf, &nr->user_addr)); |
1280 | seq_printf(seq, "%-9s ", ax2asc(&nr->dest_addr)); | 1281 | seq_printf(seq, "%-9s ", ax2asc(buf, &nr->dest_addr)); |
1281 | seq_printf(seq, | 1282 | seq_printf(seq, |
1282 | "%-9s %-3s %02X/%02X %02X/%02X %2d %3d %3d %3d %3lu/%03lu %2lu/%02lu %3lu/%03lu %3lu/%03lu %2d/%02d %3d %5d %5d %ld\n", | 1283 | "%-9s %-3s %02X/%02X %02X/%02X %2d %3d %3d %3d %3lu/%03lu %2lu/%02lu %3lu/%03lu %3lu/%03lu %2d/%02d %3d %5d %5d %ld\n", |
1283 | ax2asc(&nr->source_addr), | 1284 | ax2asc(buf, &nr->source_addr), |
1284 | devname, | 1285 | devname, |
1285 | nr->my_index, | 1286 | nr->my_index, |
1286 | nr->my_id, | 1287 | nr->my_id, |
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index 7a86b36cba50..b3b9097c87c7 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c | |||
@@ -881,6 +881,7 @@ static void nr_node_stop(struct seq_file *seq, void *v) | |||
881 | 881 | ||
882 | static int nr_node_show(struct seq_file *seq, void *v) | 882 | static int nr_node_show(struct seq_file *seq, void *v) |
883 | { | 883 | { |
884 | char buf[11]; | ||
884 | int i; | 885 | int i; |
885 | 886 | ||
886 | if (v == SEQ_START_TOKEN) | 887 | if (v == SEQ_START_TOKEN) |
@@ -890,7 +891,7 @@ static int nr_node_show(struct seq_file *seq, void *v) | |||
890 | struct nr_node *nr_node = v; | 891 | struct nr_node *nr_node = v; |
891 | nr_node_lock(nr_node); | 892 | nr_node_lock(nr_node); |
892 | seq_printf(seq, "%-9s %-7s %d %d", | 893 | seq_printf(seq, "%-9s %-7s %d %d", |
893 | ax2asc(&nr_node->callsign), | 894 | ax2asc(buf, &nr_node->callsign), |
894 | (nr_node->mnemonic[0] == '\0') ? "*" : nr_node->mnemonic, | 895 | (nr_node->mnemonic[0] == '\0') ? "*" : nr_node->mnemonic, |
895 | nr_node->which + 1, | 896 | nr_node->which + 1, |
896 | nr_node->count); | 897 | nr_node->count); |
@@ -964,6 +965,7 @@ static void nr_neigh_stop(struct seq_file *seq, void *v) | |||
964 | 965 | ||
965 | static int nr_neigh_show(struct seq_file *seq, void *v) | 966 | static int nr_neigh_show(struct seq_file *seq, void *v) |
966 | { | 967 | { |
968 | char buf[11]; | ||
967 | int i; | 969 | int i; |
968 | 970 | ||
969 | if (v == SEQ_START_TOKEN) | 971 | if (v == SEQ_START_TOKEN) |
@@ -973,7 +975,7 @@ static int nr_neigh_show(struct seq_file *seq, void *v) | |||
973 | 975 | ||
974 | seq_printf(seq, "%05d %-9s %-4s %3d %d %3d %3d", | 976 | seq_printf(seq, "%05d %-9s %-4s %3d %d %3d %3d", |
975 | nr_neigh->number, | 977 | nr_neigh->number, |
976 | ax2asc(&nr_neigh->callsign), | 978 | ax2asc(buf, &nr_neigh->callsign), |
977 | nr_neigh->dev ? nr_neigh->dev->name : "???", | 979 | nr_neigh->dev ? nr_neigh->dev->name : "???", |
978 | nr_neigh->quality, | 980 | nr_neigh->quality, |
979 | nr_neigh->locked, | 981 | nr_neigh->locked, |
@@ -983,7 +985,7 @@ static int nr_neigh_show(struct seq_file *seq, void *v) | |||
983 | if (nr_neigh->digipeat != NULL) { | 985 | if (nr_neigh->digipeat != NULL) { |
984 | for (i = 0; i < nr_neigh->digipeat->ndigi; i++) | 986 | for (i = 0; i < nr_neigh->digipeat->ndigi; i++) |
985 | seq_printf(seq, " %s", | 987 | seq_printf(seq, " %s", |
986 | ax2asc(&nr_neigh->digipeat->calls[i])); | 988 | ax2asc(buf, &nr_neigh->digipeat->calls[i])); |
987 | } | 989 | } |
988 | 990 | ||
989 | seq_puts(seq, "\n"); | 991 | seq_puts(seq, "\n"); |