From 195c12ce77680ec80ec5329f91eb3fa09bba5f01 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 May 2024 10:17:18 +0000 Subject: [PATCH] Revert "ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params()" This reverts commit 06b6de69cf160f72fc31bd660b331816681edfd9 which is commit a74f8d0aa902ca494676b79226e0b5a1747b81d4 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: If238e0b195375789db1828f9c3e940638f7ab2bf Signed-off-by: Greg Kroah-Hartman --- sound/usb/endpoint.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 7c3a0a138af2..5276b3f228e7 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1343,11 +1343,10 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, const struct audioformat *fmt = ep->cur_audiofmt; int err; - mutex_lock(&chip->mutex); /* release old buffers, if any */ err = release_urbs(ep, false); if (err < 0) - goto unlock; + return err; ep->datainterval = fmt->datainterval; ep->maxpacksize = fmt->maxpacksize; @@ -1385,16 +1384,13 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, usb_audio_dbg(chip, "Set up %d URBS, ret=%d\n", ep->nurbs, err); if (err < 0) - goto unlock; + return err; /* some unit conversions in runtime */ ep->maxframesize = ep->maxpacksize / ep->cur_frame_bytes; ep->curframesize = ep->curpacksize / ep->cur_frame_bytes; - err = update_clock_ref_rate(chip, ep); - unlock: - mutex_unlock(&chip->mutex); - return err; + return update_clock_ref_rate(chip, ep); } static int init_sample_rate(struct snd_usb_audio *chip,