All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: [bug report] ALSA: seq: Use no intrruptible mutex_lock
Date: Mon, 1 Feb 2021 16:13:14 +0300	[thread overview]
Message-ID: <YBf+arIyZvfQkDbP@mwanda> (raw)

Hello Takashi Iwai,

The patch 04702e8d0092: "ALSA: seq: Use no intrruptible mutex_lock"
from Aug 1, 2018, leads to the following static checker warning:

	sound/core/seq/seq_clientmgr.c:2194 snd_seq_create_kernel_client()
	warn: called with lock held.  '&register_mutex'

sound/core/seq/seq_midi.c
   294          if (ports > (256 / SNDRV_RAWMIDI_DEVICES))
   295                  ports = 256 / SNDRV_RAWMIDI_DEVICES;
   296  
   297          mutex_lock(&register_mutex);
                           ^^^^^^^^^^^^^^^
Holding lock

   298          client = synths[card->number];
   299          if (client == NULL) {
   300                  newclient = 1;
   301                  client = kzalloc(sizeof(*client), GFP_KERNEL);
   302                  if (client == NULL) {
   303                          mutex_unlock(&register_mutex);
   304                          kfree(info);
   305                          return -ENOMEM;
   306                  }
   307                  client->seq_client =
   308                          snd_seq_create_kernel_client(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Deadlock

   309                                  card, 0, "%s", card->shortname[0] ?
   310                                  (const char *)card->shortname : "External MIDI");
   311                  if (client->seq_client < 0) {
   312                          kfree(client);
   313                          mutex_unlock(&register_mutex);
   314                          kfree(info);
   315                          return -ENOMEM;
   316                  }
   317          }

regards,
dan carpenter

             reply	other threads:[~2021-02-01 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 13:13 Dan Carpenter [this message]
2021-02-01 13:23 ` [bug report] ALSA: seq: Use no intrruptible mutex_lock Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YBf+arIyZvfQkDbP@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.