Skip to content

Commit 00aab7d

Browse files
jhovoldJiri Kosina
authored andcommitted
HID: i2c-hid-of: fix NULL-deref on failed power up
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: [email protected] # 5.12 Cc: Douglas Anderson <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent a3bdcdd commit 00aab7d

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
@@ -87,6 +87,7 @@ static int i2c_hid_of_probe(struct i2c_client *client)
8787
if (!ihid_of)
8888
return -ENOMEM;
8989

90+
ihid_of->client = client;
9091
ihid_of->ops.power_up = i2c_hid_of_power_up;
9192
ihid_of->ops.power_down = i2c_hid_of_power_down;
9293

0 commit comments

Comments
 (0)