treewide: kmalloc() -> kmalloc_array()
[linux-block.git] / drivers / usb / misc / ldusb.c
index 236a60f53099e042faa9d804f4c470b1d5b90ef1..c2e255f02a72b822b0d4fe996968abff9477fc5a 100644 (file)
@@ -695,7 +695,10 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
                dev_warn(&intf->dev, "Interrupt out endpoint not found (using control endpoint instead)\n");
 
        dev->interrupt_in_endpoint_size = usb_endpoint_maxp(dev->interrupt_in_endpoint);
-       dev->ring_buffer = kmalloc(ring_buffer_size*(sizeof(size_t)+dev->interrupt_in_endpoint_size), GFP_KERNEL);
+       dev->ring_buffer =
+               kmalloc_array(ring_buffer_size,
+                             sizeof(size_t) + dev->interrupt_in_endpoint_size,
+                             GFP_KERNEL);
        if (!dev->ring_buffer)
                goto error;
        dev->interrupt_in_buffer = kmalloc(dev->interrupt_in_endpoint_size, GFP_KERNEL);
@@ -706,7 +709,9 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
                goto error;
        dev->interrupt_out_endpoint_size = dev->interrupt_out_endpoint ? usb_endpoint_maxp(dev->interrupt_out_endpoint) :
                                                                         udev->descriptor.bMaxPacketSize0;
-       dev->interrupt_out_buffer = kmalloc(write_buffer_size*dev->interrupt_out_endpoint_size, GFP_KERNEL);
+       dev->interrupt_out_buffer =
+               kmalloc_array(write_buffer_size,
+                             dev->interrupt_out_endpoint_size, GFP_KERNEL);
        if (!dev->interrupt_out_buffer)
                goto error;
        dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL);