Skip to content

Commit

Permalink
HID: bigbenff: prevent null pointer dereference
Browse files Browse the repository at this point in the history
commit 918aa1e upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
bentiss authored and gregkh committed Dec 14, 2021
1 parent 30d3150 commit 58f15f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-bigbenff.c
Expand Up @@ -191,7 +191,7 @@ static void bigben_worker(struct work_struct *work)
struct bigben_device, worker);
struct hid_field *report_field = bigben->report->field[0];

if (bigben->removed)
if (bigben->removed || !report_field)
return;

if (bigben->work_led) {
Expand Down

0 comments on commit 58f15f5

Please sign in to comment.