diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-12-14 15:50:34 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-17 21:59:09 -0800 |
commit | 81dcd1690697efbdf8126e78fbbf7c76d359377f (patch) | |
tree | e4408697d6e40efed6f876b7bcd133fdc93c7eb5 /net/ax25 | |
parent | 8d5cf596d10d740b69b5f4bbdb54b85abf75810d (diff) | |
download | kernel_samsung_smdk4412-81dcd1690697efbdf8126e78fbbf7c76d359377f.zip kernel_samsung_smdk4412-81dcd1690697efbdf8126e78fbbf7c76d359377f.tar.gz kernel_samsung_smdk4412-81dcd1690697efbdf8126e78fbbf7c76d359377f.tar.bz2 |
[AX.25]: Fix unchecked ax25_listen_register uses
Fix ax25_listen_register to return something that's a sane error code,
then all callers to use it.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25')
-rw-r--r-- | net/ax25/ax25_iface.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c index dd9b7fe..51e2934 100644 --- a/net/ax25/ax25_iface.c +++ b/net/ax25/ax25_iface.c @@ -154,7 +154,7 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev) return 0; if ((listen = kmalloc(sizeof(*listen), GFP_ATOMIC)) == NULL) - return 0; + return -ENOMEM; listen->callsign = *callsign; listen->dev = dev; @@ -164,7 +164,7 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev) listen_list = listen; spin_unlock_bh(&listen_lock); - return 1; + return 0; } EXPORT_SYMBOL(ax25_listen_register); @@ -225,7 +225,8 @@ int ax25_listen_mine(ax25_address *callsign, struct net_device *dev) spin_lock_bh(&listen_lock); for (listen = listen_list; listen != NULL; listen = listen->next) - if (ax25cmp(&listen->callsign, callsign) == 0 && (listen->dev == dev || listen->dev == NULL)) { + if (ax25cmp(&listen->callsign, callsign) == 0 && + (listen->dev == dev || listen->dev == NULL)) { spin_unlock_bh(&listen_lock); return 1; } |