]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
can: bcm: fix support for CAN FD frames
authorOliver Hartkopp <socketcan@hartkopp.net>
Wed, 23 Nov 2016 13:33:25 +0000 (14:33 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 23 Nov 2016 14:22:18 +0000 (15:22 +0100)
commit5499a6b22e5508b921c447757685b0a5e40a07ed
tree7beb90dee5e614fd6b29068b045f778eac11d7d1
parentc9b8af1330198ae241cd545e1f040019010d44d9
can: bcm: fix support for CAN FD frames

Since commit 6f3b911d5f29b98 ("can: bcm: add support for CAN FD frames") the
CAN broadcast manager supports CAN and CAN FD data frames.

As these data frames are embedded in struct can[fd]_frames which have a
different length the access to the provided array of CAN frames became
dependend of op->cfsiz. By using a struct canfd_frame pointer for the array of
CAN frames the new offset calculation based on op->cfsiz was accidently applied
to CAN FD frame element lengths.

This fix makes the pointer to the arrays of the different CAN frame types a
void pointer so that the offset calculation in bytes accesses the correct CAN
frame elements.

Reference: http://marc.info/?l=linux-netdev&m=147980658909653

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/bcm.c