Commit 7e5ab542 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by David S. Miller

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: default avatarRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3ec19255
...@@ -115,7 +115,7 @@ int phonet_address_del(struct net_device *dev, u8 addr) ...@@ -115,7 +115,7 @@ int phonet_address_del(struct net_device *dev, u8 addr)
pnd = __phonet_get(dev); pnd = __phonet_get(dev);
if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs))
err = -EADDRNOTAVAIL; err = -EADDRNOTAVAIL;
if (bitmap_empty(pnd->addrs, 64)) else if (bitmap_empty(pnd->addrs, 64))
__phonet_device_free(pnd); __phonet_device_free(pnd);
spin_unlock_bh(&pndevs.lock); spin_unlock_bh(&pndevs.lock);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment