diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
commit | 59223edaa18759982db0a8aced0e77457d10c68e (patch) | |
tree | 89354903b01fa0a447bffeefe00df3044495db2e /net/netrom/nr_route.c | |
parent | db7d4daea91e105e3859cf461d7e53b9b77454b2 (diff) |
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'net/netrom/nr_route.c')
-rw-r--r-- | net/netrom/nr_route.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index d46e45eb6..fa2167a46 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -564,10 +564,13 @@ struct device *nr_dev_first(void) { struct device *dev, *first = NULL; - for (dev = dev_base; dev != NULL; dev = dev->next) + read_lock(&dev_base_lock); + for (dev = dev_base; dev != NULL; dev = dev->next) { if ((dev->flags & IFF_UP) && dev->type == ARPHRD_NETROM) if (first == NULL || strncmp(dev->name, first->name, 3) < 0) first = dev; + } + read_unlock(&dev_base_lock); return first; } @@ -579,11 +582,14 @@ struct device *nr_dev_get(ax25_address *addr) { struct device *dev; - for (dev = dev_base; dev != NULL; dev = dev->next) + read_lock(&dev_base_lock); + for (dev = dev_base; dev != NULL; dev = dev->next) { if ((dev->flags & IFF_UP) && dev->type == ARPHRD_NETROM && ax25cmp(addr, (ax25_address *)dev->dev_addr) == 0) - return dev; - - return NULL; + goto out; + } +out: + read_unlock(&dev_base_lock); + return dev; } static ax25_digi *nr_call_to_digi(int ndigis, ax25_address *digipeaters) |