]> git.baikalelectronics.ru Git - 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)
commitb15651c7677939b22d4a05bc6ec26ef18529c4fb
tree7beb90dee5e614fd6b29068b045f778eac11d7d1
parentfa6f658fbe9c20c62988b50b053414b99b28b7ec
can: bcm: fix support for CAN FD frames

Since commit 01b425259932942 ("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