On 2025-09-30 13:44, Vincent Mailhol wrote:
On 9/30/25 12:06 PM, 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 intefaces device to
^^^^^^^^^
interfaces (missing "r")
Fixed in v4. Redundant typeof() was removed as well.
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 type in gs_host_frame is u8, just increase interface number limit to max size of u8 safely.
Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Reported-by: Runcheng Lu runcheng.lu@hpmicro.com Cc: stable@vger.kernel.org Signed-off-by: Celeste Liu uwu@coelacanthus.name
Reviewed-by: Vincent Mailhol mailhol@kernel.org
The patch is good as-is. However, speaking of the interface numbers, there is another issue in this gs_usb driver: net_device->dev_port is not populated, and according to the documentation, this is a bug.
See the description here:
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net
What: /sys/class/net/<iface>/dev_port
Date: February 2014
KernelVersion: 3.15
Contact: netdev@vger.kernel.org
Description:
Indicates the port number of this network device, formatted as a decimal value. Some NICs have multiple independent ports on the same PCI bus, device and function. This attribute allows userspace to distinguish the respective interfaces. Note: some device drivers started to use 'dev_id' for this purpose since long before 3.15 and have not adopted the new attribute ever since. To query the port number, some tools look exclusively at 'dev_port', while others only consult 'dev_id'. If a network device has multiple client adapter ports as described in the previous paragraph and does not set this attribute to its port number, it's a kernel bug.
Would you mind sending a separate patch (with a Fixes: tag) to resolve this?
Ok. I will send a patch for it later.
Yours sincerely, Vincent Mailhol