[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230125-hid-unregister-leds-v4-2-7860c5763c38@diag.uniroma1.it>
Date: Sun, 12 Feb 2023 19:00:00 +0000
From: Pietro Borrello <borrello@...g.uniroma1.it>
To: Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Hanno Zulla <kontakt@...no.de>, Hanno Zulla <abos@...no.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Cristiano Giuffrida <c.giuffrida@...nl>,
"Bos, H.J." <h.j.bos@...nl>, Jakob Koschel <jkl820.git@...il.com>,
Jiri Kosina <jkosina@...e.cz>,
Roderick Colenbrander <roderick@...kai.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Pietro Borrello <borrello@...g.uniroma1.it>
Subject: [PATCH v4 2/5] HID: bigben_worker() remove unneeded check on
report_field
bigben_worker() checks report_field to be non-NULL.
The check has been added in commit
918aa1ef104d ("HID: bigbenff: prevent null pointer dereference")
to prevent a NULL pointer crash.
However, the true root cause was a missing check for output
reports, patched in commit
c7bf714f8755 ("HID: check empty report_list in bigben_probe()"),
where the type-confused report list_entry was overlapping with
a NULL pointer, which was then causing the crash.
Fixes: 918aa1ef104d ("HID: bigbenff: prevent null pointer dereference")
Signed-off-by: Pietro Borrello <borrello@...g.uniroma1.it>
---
drivers/hid/hid-bigbenff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-bigbenff.c b/drivers/hid/hid-bigbenff.c
index ed3d2d7bc1dd..b98c5f31c184 100644
--- a/drivers/hid/hid-bigbenff.c
+++ b/drivers/hid/hid-bigbenff.c
@@ -197,7 +197,7 @@ static void bigben_worker(struct work_struct *work)
u32 len;
unsigned long flags;
- if (bigben->removed || !report_field)
+ if (bigben->removed)
return;
buf = hid_alloc_report_buf(bigben->report, GFP_KERNEL);
--
2.25.1
Powered by blists - more mailing lists