]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: pcan_usb: fix wrong memcpy() bytes length
authorStephane Grosjean <s.grosjean@peak-system.com>
Fri, 9 Aug 2013 09:44:06 +0000 (11:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Aug 2013 15:26:28 +0000 (08:26 -0700)
commit2efb739b6c863a77cfc362b69f755c32805a5fc2
treec3857ffc0d19b7744efa23a7def4ae3b0c404a8e
parent6e819f58e3a21214289fc7378af0889d7d344701
can: pcan_usb: fix wrong memcpy() bytes length

commit 3c322a56b01695df15c70bfdc2d02e0ccd80654e upstream.

Fix possibly wrong memcpy() bytes length since some CAN records received from
PCAN-USB could define a DLC field in range [9..15].
In that case, the real DLC value MUST be used to move forward the record pointer
but, only 8 bytes max. MUST be copied into the data field of the struct
can_frame object of the skb given to the network core.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/usb/peak_usb/pcan_usb.c