[PATCH v2] net: mediatek: add null pointer check for hardware offloading

Vadim Fedorenko vadim.fedorenko at linux.dev
Sun Jan 4 02:29:25 PST 2026


On 03/01/2026 08:30, Andrew Lunn wrote:
> On Sat, Jan 03, 2026 at 01:50:08AM +0100, Sebastian Roland Wolf wrote:
>> From: Sebastian Roland Wolf <srw at root533.premium-rootserver.net>
>>
>> Add a null pointer check to prevent kernel crashes when hardware
>> offloading is active on MediaTek devices.
>>
>> In some edge cases, the ethernet pointer or its associated netdev
>> element can be NULL. Checking these pointers before access is
>> mandatory to avoid segmentation faults and kernel oops.
> 
> Would it make sense to return EOPNOTSUPP, or maybe ENODEV? This does
> seem like an error case.

The if condition checks for single device only, while the code was added
with introduction of multiple PPEs. I believe we have to check multiple
devices from eth[], but the author may know better (CCed Elad Yifee)

> 
>       Andrew




More information about the Linux-mediatek mailing list