summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2021-12-02 10:53:32 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2021-12-02 15:36:18 +0100
commit918aa1ef104d286d16b9e7ef139a463ac7a296f0 (patch)
tree673134f33704f180f6a7465d5bf07b94c4ccd045 /drivers/hid
parent7998193bccc1c6e1537c5f3880fd0d5b949ec9d1 (diff)
downloadlinux-rpi-918aa1ef104d286d16b9e7ef139a463ac7a296f0.tar.gz
linux-rpi-918aa1ef104d286d16b9e7ef139a463ac7a296f0.tar.bz2
linux-rpi-918aa1ef104d286d16b9e7ef139a463ac7a296f0.zip
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
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-bigbenff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-bigbenff.c b/drivers/hid/hid-bigbenff.c
index db6da21ade06..74ad8bf98bfd 100644
--- a/drivers/hid/hid-bigbenff.c
+++ b/drivers/hid/hid-bigbenff.c
@@ -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) {