lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221104013236.3480427-1-aichao@kylinos.cn>
Date:   Fri,  4 Nov 2022 09:32:36 +0800
From:   aichao <aichao@...inos.cn>
To:     perex@...ex.cz, tiwai@...e.com, alsa-devel@...a-project.org
Cc:     linux-kernel@...r.kernel.org, aichao <aichao@...inos.cn>
Subject: [PATCH] ALSA: usb-audio: fix usb camero disconnect issue

When current rate is different from the runtime rate,
snd_usb_endpoint stop and close endpoint to resetting rate.
if snd_usb_endpoint close the endpoint, sometimes usb will
 disconnect the device.

Signed-off-by: aichao <aichao@...inos.cn>
---
 sound/usb/pcm.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 5dc9266180e3..2ae4a55cbaa8 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -517,7 +517,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
 		if (snd_usb_endpoint_compatible(chip, subs->data_endpoint,
 						fmt, hw_params))
 			goto unlock;
-		close_endpoints(chip, subs);
 	}
 
 	subs->data_endpoint = snd_usb_endpoint_open(chip, fmt, hw_params, false);
@@ -546,9 +545,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
 	ret = configure_endpoints(chip, subs);
 
  unlock:
-	if (ret < 0)
-		close_endpoints(chip, subs);
-
 	snd_usb_unlock_shutdown(chip);
  stop_pipeline:
 	if (ret < 0)
@@ -574,7 +570,6 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream)
 	if (!snd_usb_lock_shutdown(chip)) {
 		if (stop_endpoints(subs))
 			sync_pending_stops(subs);
-		close_endpoints(chip, subs);
 		snd_usb_unlock_shutdown(chip);
 	}
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ