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: [email protected] Signed-off-by: Benjamin Tissoires <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7998193 commit 918aa1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)