Merge tag 'asoc-v5.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[sfrench/cifs-2.6.git] / sound / usb / line6 / pcm.c
index 21127e4958b2b3338106ddac394a51560d5d1933..2c03e0f6bf72d661226b73ddee90c087db8f4b6f 100644 (file)
@@ -556,6 +556,11 @@ int line6_init_pcm(struct usb_line6 *line6,
        line6pcm->max_packet_size_out =
                usb_maxpacket(line6->usbdev,
                        usb_sndisocpipe(line6->usbdev, ep_write), 1);
+       if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {
+               dev_err(line6pcm->line6->ifcdev,
+                       "cannot get proper max packet size\n");
+               return -EINVAL;
+       }
 
        spin_lock_init(&line6pcm->out.lock);
        spin_lock_init(&line6pcm->in.lock);