Re: [Intel-wired-lan] [PATCH net] igc: Fix passing 0 to ERR_PTR in igc_xdp_run_prog()

From: Jacob Keller
Date: Thu Oct 17 2024 - 12:26:17 EST




On 10/17/2024 7:16 AM, Simon Horman wrote:
> On Wed, Oct 16, 2024 at 04:06:34PM -0700, Jacob Keller wrote:
>>
>> Not quite. PTR_ERR_OR_ZERO is intended for the case where you are
>> extracting an error from a pointer. This is converting an error into a
>> pointer.
>
> Yes, silly me.
>
>> I am not sure what is really expected here. If res is zero, shouldn't we
>> be returning an skb pointer and not NULL?
>
> Right. I think the whole point of the cited warning is that it highlights
> code that is often buggy. I think I may have tried to address it in the
> past, but if so unsuccessfully. In any case, I do think it would be good to
> dig into this and either fix it properly (or understand why it is correct
> and note that somewhere.
>

Right. I think we identified the correct fix. This same code was in i40e
and was removed in a better way.