Re: [PATCH] HID: logitech-hidpp: fix NULL pointer dereference in hidpp_get_report_length()

From: Bastien Nocera

Date: Thu Jan 15 2026 - 09:42:29 EST




On Thu, 2026-01-15 at 22:24 +0800, Kery Qi wrote:
<snip>
> - if (!report)
> + if (!report || report->maxfield < 1 || !report->field[0])

A partial fix already exists in the for-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-next&id=1547d41f9f19d691c2c9ce4c29f746297baef9e9

You'll probably want to rebase and adapt your fix. See also this review
by GregKH for v1:
https://patchwork.kernel.org/project/linux-input/patch/20260109105912.3141960-2-gnoack@xxxxxxxxxx/

Cheers

>   return 0;
>  
>   return report->field[0]->report_count + 1;