USB: serial: garmin_gps: use struct_size() to allocate pkt
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Wed, 19 Jun 2024 19:42:45 +0000 (21:42 +0200)
committerJohan Hovold <johan@kernel.org>
Fri, 5 Jul 2024 12:01:43 +0000 (14:01 +0200)
commitdf8c0b8a03e871431587a13a6765cb4c601e1573
treece46c80dc8dca02d2394bdb6bbbb2dd177565250
parent55a15b3a713a3f24360cf9d8dcfd2a3e337321d6
USB: serial: garmin_gps: use struct_size() to allocate pkt

Use the struct_size macro to calculate the size of the pkt, which
includes a trailing flexible array.

Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/garmin_gps.c