User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | net/ipv4/igmp.c |
Line in file: | 2327 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
Stanse (1.2) |
Entered: | 2012-03-04 17:07:06 UTC |
2297 if (im) { 2298 state->in_dev = in_dev; 2299 break; 2300 } 2301 read_unlock(&in_dev->mc_list_lock); 2302 in_dev_put(in_dev); 2303 } 2304 return im; 2305} 2306 2307static struct ip_mc_list *igmp_mc_get_next(struct seq_file *seq, struct ip_mc_list *im) 2308{ 2309 struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq); 2310 im = im->next; 2311 while (!im) { 2312 if (likely(state->in_dev != NULL)) { 2313 read_unlock(&state->in_dev->mc_list_lock); 2314 in_dev_put(state->in_dev); 2315 } 2316 state->dev = next_net_device(state->dev); 2317 if (!state->dev) { 2318 state->in_dev = NULL; 2319 break; 2320 } 2321 state->in_dev = in_dev_get(state->dev); 2322 if (!state->in_dev) 2323 continue; 2324 read_lock(&state->in_dev->mc_list_lock); 2325 im = state->in_dev->mc_list; 2326 } 2327 return im; 2328} 2329 2330static struct ip_mc_list *igmp_mc_get_idx(struct seq_file *seq, loff_t pos) 2331{ 2332 struct ip_mc_list *im = igmp_mc_get_first(seq); 2333 if (im) 2334 while (pos && (im = igmp_mc_get_next(seq, im)) != NULL) 2335 --pos; 2336 return pos ? NULL : im; 2337}