usb: gadget: midi2: Fix missing UMP group attributes initialization
authorTakashi Iwai <tiwai@suse.de>
Thu, 4 Sep 2025 15:39:24 +0000 (17:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Sep 2025 13:30:33 +0000 (15:30 +0200)
The gadget card driver forgot to call snd_ump_update_group_attrs()
after adding FBs, and this leaves the UMP group attributes
uninitialized.  As a result, -ENODEV error is returned at opening a
legacy rawmidi device as an inactive group.

This patch adds the missing call to address the behavior above.

Fixes: 8b645922b223 ("usb: gadget: Add support for USB MIDI 2.0 function driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20250904153932.13589-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_midi2.c

index 0a800ba53816a8c82f6d66fd759f160f4351272a..b351f9ae0fc5080c64c408d83c0450a9e19c7116 100644 (file)
@@ -1599,6 +1599,7 @@ static int f_midi2_create_card(struct f_midi2 *midi2)
                        strscpy(fb->info.name, ump_fb_name(b),
                                sizeof(fb->info.name));
                }
+               snd_ump_update_group_attrs(ump);
        }
 
        for (i = 0; i < midi2->num_eps; i++) {