diff options
Diffstat (limited to 'net/phonet')
| -rw-r--r-- | net/phonet/pn_dev.c | 2 | ||||
| -rw-r--r-- | net/phonet/pn_netlink.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 53be9fc82aaa..f93ff8ef47d0 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) | |||
| 115 | pnd = __phonet_get(dev); | 115 | pnd = __phonet_get(dev); |
| 116 | if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) | 116 | if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) |
| 117 | err = -EADDRNOTAVAIL; | 117 | err = -EADDRNOTAVAIL; |
| 118 | if (bitmap_empty(pnd->addrs, 64)) | 118 | else if (bitmap_empty(pnd->addrs, 64)) |
| 119 | __phonet_device_free(pnd); | 119 | __phonet_device_free(pnd); |
| 120 | spin_unlock_bh(&pndevs.lock); | 120 | spin_unlock_bh(&pndevs.lock); |
| 121 | return err; | 121 | return err; |
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index b1770d66bc8d..242fe8f8c322 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c | |||
| @@ -123,6 +123,7 @@ nla_put_failure: | |||
| 123 | 123 | ||
| 124 | static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | 124 | static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) |
| 125 | { | 125 | { |
| 126 | struct net *net = sock_net(skb->sk); | ||
| 126 | struct phonet_device *pnd; | 127 | struct phonet_device *pnd; |
| 127 | int dev_idx = 0, dev_start_idx = cb->args[0]; | 128 | int dev_idx = 0, dev_start_idx = cb->args[0]; |
| 128 | int addr_idx = 0, addr_start_idx = cb->args[1]; | 129 | int addr_idx = 0, addr_start_idx = cb->args[1]; |
| @@ -131,6 +132,8 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 131 | list_for_each_entry(pnd, &pndevs.list, list) { | 132 | list_for_each_entry(pnd, &pndevs.list, list) { |
| 132 | u8 addr; | 133 | u8 addr; |
| 133 | 134 | ||
| 135 | if (!net_eq(dev_net(pnd->netdev), net)) | ||
| 136 | continue; | ||
| 134 | if (dev_idx > dev_start_idx) | 137 | if (dev_idx > dev_start_idx) |
| 135 | addr_start_idx = 0; | 138 | addr_start_idx = 0; |
| 136 | if (dev_idx++ < dev_start_idx) | 139 | if (dev_idx++ < dev_start_idx) |
