[PATCH] wifi: mt76: mt7996: remove redundant NULL check in mt7996_msdu_page_get_from_cache()
Rakuram Eswaran
rakuram.e96 at gmail.com
Thu Oct 23 07:24:47 PDT 2025
On Thu, 23 Oct 2025 at 18:45, Lorenzo Bianconi <lorenzo at kernel.org> wrote:
>
> > Smatch reported a warning that the NULL check on `p` in
> > `mt7996_msdu_page_get_from_cache()` is redundant:
> >
> > drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651
> > mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL?
> >
> > The function first checks `list_empty(&dev->wed_rro.page_cache)` before
> > calling `list_first_entry()`. When the list is not empty,
> > `list_first_entry()` always returns a valid pointer and can never be NULL.
> >
> > Hence, the `if (p)` condition is unnecessary. Removing it cleans up the
> > code.
>
> Hi Rakuram,
>
> this issue has been already fixed here:
> https://patchwork.kernel.org/project/linux-wireless/patch/20251014-mt7996_msdu_page_get_from_cache-remove-null-ptr-check-v1-1-fbeb7881e192@kernel.org/
>
> Regards,
> Lorenzo
>
Hello Lorenzo,
Thank you for the information. I did check both linus-mainline and linux-next
branches before sending the patch.
>From next time, I’ll make sure to also check the subsystem-specific branches as well.
Thanks again for pointing it out.
Best regards,
Rakuram
More information about the linux-arm-kernel
mailing list