Re: [PATCH v5] net/can/gs_usb: increase max interface to U8_MAX

From: Marc Kleine-Budde

Date: Tue Sep 30 2025 - 11:40:59 EST


On 30.09.2025 19:34:28, Celeste Liu wrote:
> This issue was found by Runcheng Lu when develop HSCanT USB to CAN FD
> converter[1]. The original developers may have only 3 interfaces device to
> test so they write 3 here and wait for future change.
>
> During the HSCanT development, we actually used 4 interfaces, so the
> limitation of 3 is not enough now. But just increase one is not
> future-proofed. Since the channel index type in gs_host_frame is u8, just
> make canch[] become a flexible array with a u8 index, so it naturally
> constraint by U8_MAX and avoid statically allocate 256 pointer for
> every gs_usb device.
>
> [1]: https://github.com/cherry-embedded/HSCanT-hardware
>
> Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
> Reported-by: Runcheng Lu <runcheng.lu@xxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Reviewed-by: Vincent Mailhol <mailhol@xxxxxxxxxx>
> Signed-off-by: Celeste Liu <uwu@xxxxxxxxxxxxxxxxx>

Applied to linux-can.

Thanks,
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: signature.asc
Description: PGP signature