Message ID | 1227703319-26719-1-git-send-email-remi.denis-courmont@nokia.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Date: Wed, 26 Nov 2008 14:41:59 +0200 > 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> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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;
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> --- net/phonet/pn_dev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)