Skip to contentSkip to conversation

ALSA: caiaq: Fix potentially leftover ep1_in_urb at error path

PATCH New Takashi Iwai 1 participant 1 message Apr 27

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: caiaq: Fix potentially leftover ep1_in_urb at error path

The previous fix for handling the error from setup_card() missed that an internal URB cdev->ep1_in_urb might have been already submitted beforehand. In the normal case, this URB gets killed at the disconnection, but in the error path, we didn't do it, hence there can be a potential leak.

Fix it in the error path for setup_card(), too.

Fixes 28abd224db4a ("ALSA: caiaq: Handle probe errors properly")
---
 sound/usb/caiaq/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/caiaq/device.c +1 -1
index ad9f744b496b..1afd91e27396 100644
@@ -514,7 +514,7 @@ static int init_card(struct snd_usb_caiaqdev *cdev)
 
 	err = setup_card(cdev);
 	if (err < 0)
-		return err;
+		goto err_kill_urb;
 
 	return 0;
 
Signature · 1 line
2.53.0