Re: [PATCH] can: kvaser_usb: leaf: Fix infinite loop on zero-length cmd

Marc Kleine-Budde
2025-10-23T06:16:31Z

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

On 22.10.2025 20:39:09, pip-izony wrote:
> From: Seungjin Bae <eeodqql09@gmail.com>
>
> The `kvaser_usb_leaf_read_bulk_callback()` function parse received
> command buffers from the device. The firmware may insert zero-length
> placeholder commands to handle alignment with the USB endpoint's
> wMaxPacketSize.
>
> The driver attempts to skip these placeholders by aligning the buffer
> position `pos` to the next packet boundary using `round_up()`
> function.

What about the round_up() in kvaser_usb_leaf_wait_cmd()? Is it also
affected by this problem?

Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]