Re: [PATCH] sound: USB: line6: use dynamic buffers

From: Takashi Iwai
Date: Sun Apr 28 2019 - 12:42:17 EST


On Sun, 28 Apr 2019 18:04:11 +0200,
Greg Kroah-Hartman wrote:
>
> --- a/sound/usb/line6/toneport.c
> +++ b/sound/usb/line6/toneport.c
> @@ -365,16 +365,21 @@ static bool toneport_has_source_select(s
> /*
> Setup Toneport device.
> */
> -static void toneport_setup(struct usb_line6_toneport *toneport)
> +static int toneport_setup(struct usb_line6_toneport *toneport)
> {
> - u32 ticks;
> + u32 *ticks;
> struct usb_line6 *line6 = &toneport->line6;
> struct usb_device *usbdev = line6->usbdev;
>
> + ticks = kmalloc(sizeof(*ticks), GFP_KERNEL);
> + if (!ticks)
> + return -ENOMEM;
> +
> /* sync time on device with host: */
> /* note: 32-bit timestamps overflow in year 2106 */
> - ticks = (u32)ktime_get_real_seconds();
> - line6_write_data(line6, 0x80c6, &ticks, 4);
> + *ticks = (u32)ktime_get_real_seconds();
> + line6_write_data(line6, 0x80c6, ticks, 4);
> + kfree(ticks);
>
> /* enable device: */
> toneport_send_cmd(usbdev, 0x0301, 0x0000);

This function misses the "return 0" at the end, so I fixed it up
manually and applied now.


thanks,

Takashi