f006229135
Debian's gcc-13 [1] throws the following error in
kvaser_usb_hydra_cmd_size():
[1] gcc version 13.0.0 20221214 (experimental) [master r13-4693-g512098a3316] (Debian 13-20221214-1)
| drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c:502:65: error:
| array subscript ‘struct kvaser_cmd_ext[0]’ is partly outside array
| bounds of ‘unsigned char[32]’ [-Werror=array-bounds=]
| 502 | ret = le16_to_cpu(((struct kvaser_cmd_ext *)cmd)->len);
kvaser_usb_hydra_cmd_size() returns the size of given command. It
depends on the command number (cmd->header.cmd_no). For extended
commands (cmd->header.cmd_no == CMD_EXTENDED) the above shown code is
executed.
Help gcc to recognize that this code path is not taken in all cases,
by calling kvaser_usb_hydra_cmd_size() directly after assigning the
command number.
Fixes:
|
||
---|---|---|
.. | ||
c_can | ||
cc770 | ||
ctucanfd | ||
dev | ||
flexcan | ||
ifi_canfd | ||
m_can | ||
mscan | ||
peak_canfd | ||
rcar | ||
sja1000 | ||
slcan | ||
softing | ||
spi | ||
usb | ||
at91_can.c | ||
can327.c | ||
grcan.c | ||
janz-ican3.c | ||
Kconfig | ||
kvaser_pciefd.c | ||
Makefile | ||
sun4i_can.c | ||
ti_hecc.c | ||
vcan.c | ||
vxcan.c | ||
xilinx_can.c |