[IPV6] ADDRCONF: Sparse: Make inet6_dump_addr() code paths more straight-forward.
Fix the following sparse warning: | net/ipv6/addrconf.c:3384:2: warning: context imbalance in 'inet6_dump_addr' - different lock contexts for basic block Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
This commit is contained in:
parent
2334ecbdb2
commit
5d5619b40c
|
@ -3335,11 +3335,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
|
||||||
ifa = ifa->if_next, ip_idx++) {
|
ifa = ifa->if_next, ip_idx++) {
|
||||||
if (ip_idx < s_ip_idx)
|
if (ip_idx < s_ip_idx)
|
||||||
continue;
|
continue;
|
||||||
if ((err = inet6_fill_ifaddr(skb, ifa,
|
err = inet6_fill_ifaddr(skb, ifa,
|
||||||
NETLINK_CB(cb->skb).pid,
|
NETLINK_CB(cb->skb).pid,
|
||||||
cb->nlh->nlmsg_seq, RTM_NEWADDR,
|
cb->nlh->nlmsg_seq,
|
||||||
NLM_F_MULTI)) <= 0)
|
RTM_NEWADDR,
|
||||||
goto done;
|
NLM_F_MULTI);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MULTICAST_ADDR:
|
case MULTICAST_ADDR:
|
||||||
|
@ -3348,11 +3348,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
|
||||||
ifmca = ifmca->next, ip_idx++) {
|
ifmca = ifmca->next, ip_idx++) {
|
||||||
if (ip_idx < s_ip_idx)
|
if (ip_idx < s_ip_idx)
|
||||||
continue;
|
continue;
|
||||||
if ((err = inet6_fill_ifmcaddr(skb, ifmca,
|
err = inet6_fill_ifmcaddr(skb, ifmca,
|
||||||
NETLINK_CB(cb->skb).pid,
|
NETLINK_CB(cb->skb).pid,
|
||||||
cb->nlh->nlmsg_seq, RTM_GETMULTICAST,
|
cb->nlh->nlmsg_seq,
|
||||||
NLM_F_MULTI)) <= 0)
|
RTM_GETMULTICAST,
|
||||||
goto done;
|
NLM_F_MULTI);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ANYCAST_ADDR:
|
case ANYCAST_ADDR:
|
||||||
|
@ -3361,11 +3361,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
|
||||||
ifaca = ifaca->aca_next, ip_idx++) {
|
ifaca = ifaca->aca_next, ip_idx++) {
|
||||||
if (ip_idx < s_ip_idx)
|
if (ip_idx < s_ip_idx)
|
||||||
continue;
|
continue;
|
||||||
if ((err = inet6_fill_ifacaddr(skb, ifaca,
|
err = inet6_fill_ifacaddr(skb, ifaca,
|
||||||
NETLINK_CB(cb->skb).pid,
|
NETLINK_CB(cb->skb).pid,
|
||||||
cb->nlh->nlmsg_seq, RTM_GETANYCAST,
|
cb->nlh->nlmsg_seq,
|
||||||
NLM_F_MULTI)) <= 0)
|
RTM_GETANYCAST,
|
||||||
goto done;
|
NLM_F_MULTI);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -3373,14 +3373,12 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
|
||||||
}
|
}
|
||||||
read_unlock_bh(&idev->lock);
|
read_unlock_bh(&idev->lock);
|
||||||
in6_dev_put(idev);
|
in6_dev_put(idev);
|
||||||
|
|
||||||
|
if (err <= 0)
|
||||||
|
break;
|
||||||
cont:
|
cont:
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
done:
|
|
||||||
if (err <= 0) {
|
|
||||||
read_unlock_bh(&idev->lock);
|
|
||||||
in6_dev_put(idev);
|
|
||||||
}
|
|
||||||
cb->args[0] = idx;
|
cb->args[0] = idx;
|
||||||
cb->args[1] = ip_idx;
|
cb->args[1] = ip_idx;
|
||||||
return skb->len;
|
return skb->len;
|
||||||
|
|
Loading…
Reference in New Issue