summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index c39cc6851e2d..cfc1ea53978d 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -668,14 +668,15 @@ static void i_usx2y_04int(struct urb *urb)
static int usx2y_rate_set(struct usx2ydev *usx2y, int rate)
{
- int err = 0, i;
- struct snd_usx2y_urb_seq *us = NULL;
- int *usbdata = NULL;
- const struct s_c2 *ra = rate == 48000 ? setrate_48000 : setrate_44100;
+ int err = 0, i;
+ struct snd_usx2y_urb_seq *us = NULL;
+ int *usbdata = NULL;
+ const struct s_c2 *ra = rate == 48000 ? setrate_48000 : setrate_44100;
struct urb *urb;
if (usx2y->rate != rate) {
- us = kzalloc(sizeof(*us) + sizeof(struct urb *) * NOOF_SETRATE_URBS, GFP_KERNEL);
+ us = kzalloc(struct_size(us, urb, NOOF_SETRATE_URBS),
+ GFP_KERNEL);
if (!us) {
err = -ENOMEM;
goto cleanup;