[lvc-project] [PATCH net 3/3] net: fealnx: allocate the card index from an IDA
Andrew Lunn
andrew at lunn.ch
Thu Sep 24 19:50:43 MSK 2026
On Thu, Sep 24, 2026 at 10:44:25AM +0000, Жамбакиев Радий Рикардинович wrote:
> From: Radiy Zhambakiev <r.zhambakiev at prosoftsystems.ru>
>
> card_idx is a static counter that is incremented on every probe.
> It can overflow and wrap to a negative value, which then indexes
> options[] and full_duplex[] out of bounds. Large values also no
> longer fit in the 12-byte boardname[] buffer.
Seems very theoretical. For something which is never going to happen,
please keep it KISS:
if (card_idx > 100000) {
dev_error(..., "Please stop doing that!");
return -ENODEV;
}
Andrew
---
pw-bot: cr
More information about the lvc-project
mailing list