Thread (4 messages) 4 messages, 1 author, 3d ago

[PATCH 1/4] Input: da7280 - fix input device parent assignment

flat view
WARM3d

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2026-10-08 09:47:41
Also in: lkml
Subsystem: dialog semiconductor drivers, input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Support Opensource, Dmitry Torokhov, Linus Torvalds

Assigning the I2C bus controller (client->dev.parent) instead of the
I2C client (&client->dev) as the parent device after
devm_input_allocate_device() causes input_register_device() to attach
the devm unregistration action to the parent controller device rather
than the client device. This leaves the input device registered on
driver unbind, leading to use-after-free.

devm_input_allocate_device() already sets input_dev->dev.parent to
&client->dev. Drop the redundant and erroneous assignment.

Fixes: cd3f609823a5 ("Input: new da7280 haptic driver")
Assisted-by: LLM
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/misc/da7280.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index 77fcf868dca2..e607836efb50 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -1218,7 +1218,6 @@ static int da7280_probe(struct i2c_client *client)
 	}
 
 	input_dev->name = "da7280-haptic";
-	input_dev->dev.parent = client->dev.parent;
 	input_dev->open = da7280_haptic_open;
 	input_dev->close = da7280_haptic_close;
 	input_set_drvdata(input_dev, haptics);
-- 
2.56.0.385.gd3acb90ef8-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help