sound fixes for 5.3-rc3

- A further fix for syzcaller issues with USB-audio, addressing
   NULL dereference that was introduced by the recent fix
 - Avoid a long delay at boot with HD-audio when i915 module was
   built but not installed, found on some Debian systems
 - A fix of small race window at PCM draining
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl1EAPUOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/UKw/+J7YWMbLMDUNlmCFBi2MStSc898LB3UsB+W+O
 VGsluaiv9ZkyVmu/v6D4HqLDNCzNsqpg1NSNIDOAM/RBdsOjR1PYO0LZWED1hQet
 frYiaIEx9xOKV8b1Q4X0soQY7OztXTOWvB5qzhl+HhAijhPaoMcjP0g6kqQiIRwQ
 CxMljNAmE9pikFCqrmzi1XdaMr73tllfaAfUfNqvSoBTh++t3y3xt0OTEshsvidS
 Df/3/rF+apRavyFoyGdXGNZsP16T1crWN1g2Ln/i2kCyCLU/YsVj290fnS3WJAzH
 gMwridTLUaGF8gTbvwIdyKXejnK2gUqz6Kp/2m6v1DGQZxhdFzTbc1TMurqqc54K
 1vAul0lFFrc9AIsTnBucTpUbI4enMcwXlrUBCU57NezjK60cMd6NWLv1wJIkD1el
 WxDliDrHPuhgf6w6FiT3Ul+YirvcNm/zJKQSs/yDoj6GfjETgIoXQgoAP4HQK/XG
 DrfQRvujFzv4tMiP7aaSCGe0zoGR09SwJdQyYTtxkD58GKtBFkX1/jiM682eAfSB
 cIw44yKXto+P/g8BQYi+TgdTMBV/JKX2Oa0B2nhhOl1rHe6T2fKkKAqSN/J7EcYg
 /Hx6NQglSos2+r9pk3nofvdBC9nT9KQgqDOGzKuBvPeY7cCbv5BsZlBkKJ46bplt
 7IwtXho=
 =IaLJ
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:

 - A further fix for syzcaller issues with USB-audio, addressing NULL
   dereference that was introduced by the recent fix

 - Avoid a long delay at boot with HD-audio when i915 module was built
   but not installed, found on some Debian systems

 - A fix of small race window at PCM draining

* tag 'sound-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Fix gpf in snd_usb_pipe_sanity_check
  ALSA: pcm: fix lost wakeup event scenarios in snd_pcm_drain
  ALSA: hda: Fix 1-minute detection delay when i915 module is not available
This commit is contained in:
Linus Torvalds 2019-08-02 08:53:34 -07:00
commit 75cdf416b3
3 changed files with 9 additions and 6 deletions

View File

@ -1873,6 +1873,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
if (!to_check) if (!to_check)
break; /* all drained */ break; /* all drained */
init_waitqueue_entry(&wait, current); init_waitqueue_entry(&wait, current);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&to_check->sleep, &wait); add_wait_queue(&to_check->sleep, &wait);
snd_pcm_stream_unlock_irq(substream); snd_pcm_stream_unlock_irq(substream);
if (runtime->no_period_wakeup) if (runtime->no_period_wakeup)
@ -1885,7 +1886,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
} }
tout = msecs_to_jiffies(tout * 1000); tout = msecs_to_jiffies(tout * 1000);
} }
tout = schedule_timeout_interruptible(tout); tout = schedule_timeout(tout);
snd_pcm_stream_lock_irq(substream); snd_pcm_stream_lock_irq(substream);
group = snd_pcm_stream_group_ref(substream); group = snd_pcm_stream_group_ref(substream);

View File

@ -136,10 +136,12 @@ int snd_hdac_i915_init(struct hdac_bus *bus)
if (!acomp) if (!acomp)
return -ENODEV; return -ENODEV;
if (!acomp->ops) { if (!acomp->ops) {
request_module("i915"); if (!IS_ENABLED(CONFIG_MODULES) ||
/* 60s timeout */ !request_module("i915")) {
wait_for_completion_timeout(&bind_complete, /* 60s timeout */
msecs_to_jiffies(60 * 1000)); wait_for_completion_timeout(&bind_complete,
msecs_to_jiffies(60 * 1000));
}
} }
if (!acomp->ops) { if (!acomp->ops) {
dev_info(bus->dev, "couldn't bind with audio component\n"); dev_info(bus->dev, "couldn't bind with audio component\n");

View File

@ -72,7 +72,7 @@ int snd_usb_pipe_sanity_check(struct usb_device *dev, unsigned int pipe)
struct usb_host_endpoint *ep; struct usb_host_endpoint *ep;
ep = usb_pipe_endpoint(dev, pipe); ep = usb_pipe_endpoint(dev, pipe);
if (usb_pipetype(pipe) != pipetypes[usb_endpoint_type(&ep->desc)]) if (!ep || usb_pipetype(pipe) != pipetypes[usb_endpoint_type(&ep->desc)])
return -EINVAL; return -EINVAL;
return 0; return 0;
} }