]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/usb/caiaq/audio.c
treewide: kmalloc() -> kmalloc_array()
[linux.git] / sound / usb / caiaq / audio.c
index fb1c1eac0b5ef3b56cd9b9873d46f694eda43457..f35d29f49ffe13afae1501c219d500e8f3212383 100644 (file)
@@ -728,7 +728,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret)
                usb_sndisocpipe(usb_dev, ENDPOINT_PLAYBACK) :
                usb_rcvisocpipe(usb_dev, ENDPOINT_CAPTURE);
 
-       urbs = kmalloc(N_URBS * sizeof(*urbs), GFP_KERNEL);
+       urbs = kmalloc_array(N_URBS, sizeof(*urbs), GFP_KERNEL);
        if (!urbs) {
                *ret = -ENOMEM;
                return NULL;
@@ -742,7 +742,8 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret)
                }
 
                urbs[i]->transfer_buffer =
-                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
+                       kmalloc_array(BYTES_PER_FRAME, FRAMES_PER_URB,
+                                     GFP_KERNEL);
                if (!urbs[i]->transfer_buffer) {
                        *ret = -ENOMEM;
                        return urbs;
@@ -857,7 +858,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev)
                                &snd_usb_caiaq_ops);
 
        cdev->data_cb_info =
-               kmalloc(sizeof(struct snd_usb_caiaq_cb_info) * N_URBS,
+               kmalloc_array(N_URBS, sizeof(struct snd_usb_caiaq_cb_info),
                                        GFP_KERNEL);
 
        if (!cdev->data_cb_info)