Skip to content

Commit

Permalink
Phonet: fix oops in phonet_address_del() on non-Phonet device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Nov 26, 2008
1 parent 3ec1925 commit 7e5ab54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/phonet/pn_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7e5ab54

Please sign in to comment.