Commit 73eee567 authored by Cristina Moraru's avatar Cristina Moraru Committed by Greg Kroah-Hartman

staging: octeon-usb: Replace kmalloc with kmalloc_array

Replace kmalloc with specialized function kmalloc_array
when the size is a multiplication of:
	number_of_elements * size_of_element
Signed-off-by: default avatarCristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ffca44fb
...@@ -3216,7 +3216,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, ...@@ -3216,7 +3216,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd,
* Allocate a structure to use for our private list of * Allocate a structure to use for our private list of
* isochronous packets. * isochronous packets.
*/ */
iso_packet = kmalloc(urb->number_of_packets * iso_packet = kmalloc_array(urb->number_of_packets,
sizeof(struct cvmx_usb_iso_packet), sizeof(struct cvmx_usb_iso_packet),
GFP_ATOMIC); GFP_ATOMIC);
if (iso_packet) { if (iso_packet) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment