[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <519b3bb9-2fa2-4447-94b3-91c7a45bf54b@oracle.com>
Date: Mon, 17 Nov 2025 16:18:02 +0530
From: ALOK TIWARI <alok.a.tiwari@...cle.com>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: alok.a.tiwarilinux@...il.com, michal.kubiak@...el.com,
przemyslaw.kitszel@...el.com, anthony.l.nguyen@...el.com,
andrew+netdev@...n.ch, kuba@...nel.org, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, horms@...nel.org,
intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org
Subject: Re: [External] : Re: [PATCH net] idpf: Fix incorrect NULL check in
completion descriptor release
On 11/17/2025 4:00 PM, Alexander Lobakin wrote:
>> idpf_compl_queue uses a union for comp, comp_4b, and desc_ring.
>> The release path should check complq->desc_ring to determine whether the
>> DMA descriptor ring was allocated. The existing check against
>> complq->comp is incorrect, as only desc_ring reliably reflects the
>> allocation status.
> How can it be "incorrect" if these 3 are in the same union and have the
> same size of 1 pointer? Any of them reflects the allocation status.
>
> While your change improves readability, it doesn't fixes anything at
> all. You can compare the object code to see there's no difference
> before/after.
>
> C unions are not the same as C++ unions, but even if the kernel had
> `-fstrict-aliasing` enabled (and it's always disabled), the result would
> be same. And C unions definitely don't work like std::variant.
>
> So this could only go to -next as a cosmetic change if you really want this.
>
Thanks, Alex.
Agreed the check is functionally identical. I’ll mark it for net-next.
Thanks,
Alok
Powered by blists - more mailing lists