Skip to content

Commit 918aa1e

Browse files
committed
HID: bigbenff: prevent null pointer dereference
When emulating the device through uhid, there is a chance we don't have output reports and so report_field is null. Cc: stable@vger.kernel.org Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20211202095334.14399-3-benjamin.tissoires@redhat.com
1 parent 7998193 commit 918aa1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hid/hid-bigbenff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void bigben_worker(struct work_struct *work)
191191
struct bigben_device, worker);
192192
struct hid_field *report_field = bigben->report->field[0];
193193

194-
if (bigben->removed)
194+
if (bigben->removed || !report_field)
195195
return;
196196

197197
if (bigben->work_led) {

0 commit comments

Comments
 (0)