diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-05-17 15:15:42 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-05-17 16:05:10 +0200 |
commit | 64a06f195d3b2d65141b32c80d6b7f0db4df6cb5 (patch) | |
tree | 97bfb181a1a658fd4b1621dd1458d96fd03f3791 /sound/usb/usx2y/usbusx2y.c | |
parent | c1f24841683f5ce902e49d35ba84abc3e3886427 (diff) |
ALSA: usx2y: Fix shmem initialization
Currently us428ctls_shmem pages are allocated dynamically upon the
mmap call, but this is quite racy. Since the shared memory itself is
mandatory for the mmap, let's allocate it at the beginning of the card
initialization. Also, fix the initialization of the wait queue, too.
Link: https://lore.kernel.org/r/20210517131545.27252-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/usbusx2y.c')
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index d2e1cf163521..09ead00e395e 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c @@ -375,6 +375,7 @@ static int usx2y_create_card(struct usb_device *device, card->private_free = snd_usx2y_card_private_free; usx2y(card)->dev = device; init_waitqueue_head(&usx2y(card)->prepare_wait_queue); + init_waitqueue_head(&usx2y(card)->us428ctls_wait_queue_head); mutex_init(&usx2y(card)->pcm_mutex); INIT_LIST_HEAD(&usx2y(card)->midi_list); strcpy(card->driver, "USB "NAME_ALLCAPS""); |