Merge branch 'for-linus' into for-next
This commit is contained in:
@@ -221,6 +221,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
|
||||
struct usb_interface_descriptor *altsd;
|
||||
void *control_header;
|
||||
int i, protocol;
|
||||
int rest_bytes;
|
||||
|
||||
/* find audiocontrol interface */
|
||||
host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0];
|
||||
@@ -235,6 +236,15 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rest_bytes = (void *)(host_iface->extra + host_iface->extralen) -
|
||||
control_header;
|
||||
|
||||
/* just to be sure -- this shouldn't hit at all */
|
||||
if (rest_bytes <= 0) {
|
||||
dev_err(&dev->dev, "invalid control header\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (protocol) {
|
||||
default:
|
||||
dev_warn(&dev->dev,
|
||||
@@ -245,11 +255,21 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
|
||||
case UAC_VERSION_1: {
|
||||
struct uac1_ac_header_descriptor *h1 = control_header;
|
||||
|
||||
if (rest_bytes < sizeof(*h1)) {
|
||||
dev_err(&dev->dev, "too short v1 buffer descriptor\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!h1->bInCollection) {
|
||||
dev_info(&dev->dev, "skipping empty audio interface (v1)\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (rest_bytes < h1->bLength) {
|
||||
dev_err(&dev->dev, "invalid buffer length (v1)\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (h1->bLength < sizeof(*h1) + h1->bInCollection) {
|
||||
dev_err(&dev->dev, "invalid UAC_HEADER (v1)\n");
|
||||
return -EINVAL;
|
||||
|
@@ -1137,6 +1137,9 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
|
||||
case USB_ID(0x047F, 0x02F7): /* Plantronics BT-600 */
|
||||
case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */
|
||||
case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */
|
||||
case USB_ID(0x047F, 0xC022): /* Plantronics C310 */
|
||||
case USB_ID(0x047F, 0xC02F): /* Plantronics P610 */
|
||||
case USB_ID(0x047F, 0xC036): /* Plantronics C520-M */
|
||||
case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */
|
||||
case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */
|
||||
case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */
|
||||
|
@@ -191,7 +191,8 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
|
||||
}
|
||||
|
||||
pg = get_order(read_size);
|
||||
sk->s = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
|
||||
sk->s = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO|
|
||||
__GFP_NOWARN, pg);
|
||||
if (!sk->s) {
|
||||
snd_printk(KERN_WARNING "couldn't __get_free_pages()\n");
|
||||
goto out;
|
||||
@@ -211,7 +212,8 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
|
||||
pg = get_order(write_size);
|
||||
|
||||
sk->write_page =
|
||||
(void *)__get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
|
||||
(void *)__get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO|
|
||||
__GFP_NOWARN, pg);
|
||||
if (!sk->write_page) {
|
||||
snd_printk(KERN_WARNING "couldn't __get_free_pages()\n");
|
||||
usb_stream_free(sk);
|
||||
|
Fai riferimento in un nuovo problema
Block a user