aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-01-22 03:29:40 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:10:28 -0500
commit5d5619b40c2474de01c64bdf6bb9f1211d3e967a (patch)
tree4e128d0dad98f351973edf7af1989343371465b4 /net/ipv6/addrconf.c
parent2334ecbdb27bd1745c0fc6d05cce09ed9585e4c1 (diff)
[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>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index aba7b5d52a9f..e40213db9e4c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3335,11 +3335,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
3335 ifa = ifa->if_next, ip_idx++) { 3335 ifa = ifa->if_next, ip_idx++) {
3336 if (ip_idx < s_ip_idx) 3336 if (ip_idx < s_ip_idx)
3337 continue; 3337 continue;
3338 if ((err = inet6_fill_ifaddr(skb, ifa, 3338 err = inet6_fill_ifaddr(skb, ifa,
3339 NETLINK_CB(cb->skb).pid, 3339 NETLINK_CB(cb->skb).pid,
3340 cb->nlh->nlmsg_seq, RTM_NEWADDR, 3340 cb->nlh->nlmsg_seq,
3341 NLM_F_MULTI)) <= 0) 3341 RTM_NEWADDR,
3342 goto done; 3342 NLM_F_MULTI);
3343 } 3343 }
3344 break; 3344 break;
3345 case MULTICAST_ADDR: 3345 case MULTICAST_ADDR:
@@ -3348,11 +3348,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
3348 ifmca = ifmca->next, ip_idx++) { 3348 ifmca = ifmca->next, ip_idx++) {
3349 if (ip_idx < s_ip_idx) 3349 if (ip_idx < s_ip_idx)
3350 continue; 3350 continue;
3351 if ((err = inet6_fill_ifmcaddr(skb, ifmca, 3351 err = inet6_fill_ifmcaddr(skb, ifmca,
3352 NETLINK_CB(cb->skb).pid, 3352 NETLINK_CB(cb->skb).pid,
3353 cb->nlh->nlmsg_seq, RTM_GETMULTICAST, 3353 cb->nlh->nlmsg_seq,
3354 NLM_F_MULTI)) <= 0) 3354 RTM_GETMULTICAST,
3355 goto done; 3355 NLM_F_MULTI);
3356 } 3356 }
3357 break; 3357 break;
3358 case ANYCAST_ADDR: 3358 case ANYCAST_ADDR:
@@ -3361,11 +3361,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
3361 ifaca = ifaca->aca_next, ip_idx++) { 3361 ifaca = ifaca->aca_next, ip_idx++) {
3362 if (ip_idx < s_ip_idx) 3362 if (ip_idx < s_ip_idx)
3363 continue; 3363 continue;
3364 if ((err = inet6_fill_ifacaddr(skb, ifaca, 3364 err = inet6_fill_ifacaddr(skb, ifaca,
3365 NETLINK_CB(cb->skb).pid, 3365 NETLINK_CB(cb->skb).pid,
3366 cb->nlh->nlmsg_seq, RTM_GETANYCAST, 3366 cb->nlh->nlmsg_seq,
3367 NLM_F_MULTI)) <= 0) 3367 RTM_GETANYCAST,
3368 goto done; 3368 NLM_F_MULTI);
3369 } 3369 }
3370 break; 3370 break;
3371 default: 3371 default:
@@ -3373,14 +3373,12 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
3373 } 3373 }
3374 read_unlock_bh(&idev->lock); 3374 read_unlock_bh(&idev->lock);
3375 in6_dev_put(idev); 3375 in6_dev_put(idev);
3376
3377 if (err <= 0)
3378 break;
3376cont: 3379cont:
3377 idx++; 3380 idx++;
3378 } 3381 }
3379done:
3380 if (err <= 0) {
3381 read_unlock_bh(&idev->lock);
3382 in6_dev_put(idev);
3383 }
3384 cb->args[0] = idx; 3382 cb->args[0] = idx;
3385 cb->args[1] = ip_idx; 3383 cb->args[1] = ip_idx;
3386 return skb->len; 3384 return skb->len;