diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2021-12-02 12:53:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-14 13:32:34 +0300 |
commit | 6272b17001e6fdcf7b4a16206287010a1523fa6e (patch) | |
tree | 86b44f75fcb537459c8fa870a3459495aa50d136 /drivers/hid/hid-bigbenff.c | |
parent | d877651afd60dcbbcdc31f9efded3c27813afd1a (diff) | |
download | linux-6272b17001e6fdcf7b4a16206287010a1523fa6e.tar.xz |
HID: bigbenff: prevent null pointer dereference
commit 918aa1ef104d286d16b9e7ef139a463ac7a296f0 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>
Diffstat (limited to 'drivers/hid/hid-bigbenff.c')
-rw-r--r-- | drivers/hid/hid-bigbenff.c | 2 |
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) { |