Skip to content

Commit 85cf311

Browse files
committed
HID: i2c-hid-of: fix NULL-deref on failed power up
jira LE-3201 cve CVE-2024-26717 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.22.1.rt7.363.el8_10 commit-author Johan Hovold <johan+linaro@kernel.org> commit 00aab7d A while back the I2C HID implementation was split in an ACPI and OF part, but the new OF driver never initialises the client pointer which is dereferenced on power-up failures. Fixes: b33752c ("HID: i2c-hid: Reorganize so ACPI and OF are separate modules") Cc: stable@vger.kernel.org # 5.12 Cc: Douglas Anderson <dianders@chromium.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.com> (cherry picked from commit 00aab7d) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 14a3858 commit 85cf311

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/hid/i2c-hid/i2c-hid-of.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static int i2c_hid_of_probe(struct i2c_client *client,
7878
if (!ihid_of)
7979
return -ENOMEM;
8080

81+
ihid_of->client = client;
8182
ihid_of->ops.power_up = i2c_hid_of_power_up;
8283
ihid_of->ops.power_down = i2c_hid_of_power_down;
8384

0 commit comments

Comments
 (0)