usb: xhci: use array_size() when allocating and freeing memory
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Mon, 29 Apr 2024 14:02:34 +0000 (17:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 May 2024 06:47:14 +0000 (08:47 +0200)
commit0c9595089432c152640aa75cf14e76d5510965f4
treeca7e678b94e0bb0c11413fd330cebf88e18587c8
parent7e2bd7dd80841729993ca6903dbf58b3b2b2b565
usb: xhci: use array_size() when allocating and freeing memory

Replace size_mul() with array_size() in memory allocation and freeing
processes, it fits better semantically.

Macro array_size() is identical to size_mult(), which clamps the max size,
so it's imperative that array_size() is used when freeing said memory.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240429140245.3955523-8-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c