Showing error 1565

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


Source:

604        .pointer =        snd_usX2Y_pcm_pointer,
605};
606
607
608static int usX2Y_pcms_lock_check(struct snd_card *card)
609{
610        struct list_head *list;
611        struct snd_device *dev;
612        struct snd_pcm *pcm;
613        int err = 0;
614        list_for_each(list, &card->devices) {
615                dev = snd_device(list);
616                if (dev->type != SNDRV_DEV_PCM)
617                        continue;
618                pcm = dev->device_data;
619                mutex_lock(&pcm->open_mutex);
620        }
621        list_for_each(list, &card->devices) {
622                int s;
623                dev = snd_device(list);
624                if (dev->type != SNDRV_DEV_PCM)
625                        continue;
626                pcm = dev->device_data;
627                for (s = 0; s < 2; ++s) {
628                        struct snd_pcm_substream *substream;
629                        substream = pcm->streams[s].substream;
630                        if (substream && SUBSTREAM_BUSY(substream))
631                                err = -EBUSY;
632                }
633        }
634        return err;
635}
636
637
638static void usX2Y_pcms_unlock(struct snd_card *card)
639{
640        struct list_head *list;
641        struct snd_device *dev;
642        struct snd_pcm *pcm;
643        list_for_each(list, &card->devices) {
644                dev = snd_device(list);
Show full sources