Commit 27b57bb7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "Revert "ALSA: usx2y: Fix potential NULL pointer dereference""



This reverts commit 4667a6fc.

Takashi writes:
	I have already started working on the bigger cleanup of this driver
	code based on 5.13-rc1, so could you drop this revert?

I missed our previous discussion about this, my fault for applying it.

Reported-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a3626bcf
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -91,7 +91,12 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,


	for (u = 0; u < USB_STREAM_NURBS; ++u) {
	for (u = 0; u < USB_STREAM_NURBS; ++u) {
		sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
		sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
		if (!sk->inurb[u])
			return -ENOMEM;

		sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
		sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
		if (!sk->outurb[u])
			return -ENOMEM;
	}
	}


	if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
	if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||