mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
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: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ffca44fb93
commit
73eee567cb
@ -3216,9 +3216,9 @@ 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) {
|
||||||
int i;
|
int i;
|
||||||
/* Fill the list with the data from the URB */
|
/* Fill the list with the data from the URB */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user