summaryrefslogtreecommitdiffstats
path: root/net/phonet
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2008-11-26 15:26:43 -0800
committerDavid S. Miller <davem@davemloft.net>2008-11-26 15:26:43 -0800
commit7e5ab54296a41f590c9cbc976e1c86272f3a7e00 (patch)
treee3ccf692a222e7c797b3cdbddfc8b09ef8e69d1a /net/phonet
parent3ec192559033ed457f0d7856838654c100fc659f (diff)
downloadop-kernel-dev-7e5ab54296a41f590c9cbc976e1c86272f3a7e00.zip
op-kernel-dev-7e5ab54296a41f590c9cbc976e1c86272f3a7e00.tar.gz
Phonet: fix oops in phonet_address_del() on non-Phonet device
A NULL dereference would occur when trying to delete an addres from a network device that does not have any Phonet address. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet')
-rw-r--r--net/phonet/pn_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 53be9fc..f93ff8e 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -115,7 +115,7 @@ int phonet_address_del(struct net_device *dev, u8 addr)
pnd = __phonet_get(dev);
if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs))
err = -EADDRNOTAVAIL;
- if (bitmap_empty(pnd->addrs, 64))
+ else if (bitmap_empty(pnd->addrs, 64))
__phonet_device_free(pnd);
spin_unlock_bh(&pndevs.lock);
return err;
OpenPOWER on IntegriCloud