Showing error 920

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/pci/mixart/mixart.c
Line in file: 610
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 82f5d57163abed2e5ff271d03217b6f90c616eb8
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

 580{
 581        struct snd_mixart *chip = snd_pcm_substream_chip(subs);
 582        struct mixart_mgr *mgr = chip->mgr;
 583        struct mixart_stream *stream = subs->runtime->private_data;
 584        snd_pcm_format_t format;
 585        int err;
 586        int channels;
 587
 588        /* set up channels */
 589        channels = params_channels(hw);
 590
 591        /*  set up format for the stream */
 592        format = params_format(hw);
 593
 594        mutex_lock(&mgr->setup_mutex);
 595
 596        /* update the stream levels */
 597        if( stream->pcm_number <= MIXART_PCM_DIGITAL ) {
 598                int is_aes = stream->pcm_number > MIXART_PCM_ANALOG;
 599                if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK )
 600                        mixart_update_playback_stream_level(chip, is_aes, subs->number);
 601                else
 602                        mixart_update_capture_stream_level( chip, is_aes);
 603        }
 604
 605        stream->channels = channels;
 606
 607        /* set the format to the board */
 608        err = mixart_set_format(stream, format);
 609        if(err < 0) {
 610                return err;
 611        }
 612
 613        /* allocate buffer */
 614        err = snd_pcm_lib_malloc_pages(subs, params_buffer_bytes(hw));
 615
 616        if (err > 0) {
 617                struct mixart_bufferinfo *bufferinfo;
 618                int i = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (stream->pcm_number * (MIXART_PLAYBACK_STREAMS+MIXART_CAPTURE_STREAMS)) + subs->number;
 619                if( subs->stream == SNDRV_PCM_STREAM_CAPTURE ) {
 620                        i += MIXART_PLAYBACK_STREAMS; /* in array capture is behind playback */
Show full sources