Showing error 1563

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


Source:

 336                if (soutput->opened)
 337                        goto __skip_output;
 338                if ((err = snd_rawmidi_runtime_create(soutput)) < 0) {
 339                        if (mode & SNDRV_RAWMIDI_LFLG_INPUT)
 340                                sinput->ops->close(sinput);
 341                        goto __error;
 342                }
 343                output = soutput->runtime;
 344                if ((err = soutput->ops->open(soutput)) < 0) {
 345                        if (mode & SNDRV_RAWMIDI_LFLG_INPUT)
 346                                sinput->ops->close(sinput);
 347                        goto __error;
 348                }
 349              __skip_output:
 350                soutput->opened = 1;
 351                if (mode & SNDRV_RAWMIDI_LFLG_APPEND)
 352                        soutput->append = 1;
 353                      if (soutput->use_count++ == 0)
 354                        soutput->active_sensing = 1;
 355                rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substream_opened++;
 356        } else {
 357                soutput = NULL;
 358        }
 359        if (!(mode & SNDRV_RAWMIDI_LFLG_NOOPENLOCK))
 360                mutex_unlock(&rmidi->open_mutex);
 361        if (rfile) {
 362                rfile->rmidi = rmidi;
 363                rfile->input = sinput;
 364                rfile->output = soutput;
 365        }
 366        return 0;
 367
 368      __error:
 369        if (input != NULL)
 370                snd_rawmidi_runtime_free(sinput);
 371        if (output != NULL)
 372                snd_rawmidi_runtime_free(soutput);
 373        module_put(rmidi->card->module);
 374        if (!(mode & SNDRV_RAWMIDI_LFLG_NOOPENLOCK))
 375                mutex_unlock(&rmidi->open_mutex);
 376      __error1:
Show full sources