Showing error 1504

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/irda/discovery.c
Line in file: 339
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

309                }
310                discovery = (discovery_t *) hashbin_get_next(log);
311        }
312
313        spin_unlock_irqrestore(&log->hb_spinlock, flags);
314
315        /* Get the actual number of device in the buffer and return */
316        *pn = i;
317        return(buffer);
318}
319
320#ifdef CONFIG_PROC_FS
321static inline discovery_t *discovery_seq_idx(loff_t pos)
322
323{
324        discovery_t *discovery;
325
326        for (discovery = (discovery_t *) hashbin_get_first(irlmp->cachelog);
327             discovery != NULL;
328             discovery = (discovery_t *) hashbin_get_next(irlmp->cachelog)) {
329                if (pos-- == 0)
330                        break;
331        }
332
333        return discovery;
334}
335
336static void *discovery_seq_start(struct seq_file *seq, loff_t *pos)
337{
338        spin_lock_irq(&irlmp->cachelog->hb_spinlock);
339        return *pos ? discovery_seq_idx(*pos - 1) : SEQ_START_TOKEN;
340}
341
342static void *discovery_seq_next(struct seq_file *seq, void *v, loff_t *pos)
343{
344        ++*pos;
345        return (v == SEQ_START_TOKEN)
346                ? (void *) hashbin_get_first(irlmp->cachelog)
347                : (void *) hashbin_get_next(irlmp->cachelog);
348}
349
Show full sources