Skip to content

Commit

Permalink
Input: drv260x - fix input device's parent assignment
Browse files Browse the repository at this point in the history
We were assigning I2C bus controller instead of client as parent device.
Besides being logically wrong, it messed up with devm handling of input
device. As a result we were leaving input device and event node behind
after rmmod-ing the driver, which lead to a kernel oops if one were to
access the event node later.

Let's remove the assignment and rely on devm_input_allocate_device() to
set it up properly for us.

Signed-off-by: Jingkui Wang <jkwang@google.com>
Fixes: 7132fe4 ("Input: drv260x - add TI drv260x haptics driver")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Jingkui Wang authored and Dmitry Torokhov committed Dec 12, 2016
1 parent 74c82da commit 5a8a6b8
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/input/misc/drv260x.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ static int drv260x_probe(struct i2c_client *client,
}

haptics->input_dev->name = "drv260x:haptics";
haptics->input_dev->dev.parent = client->dev.parent;
haptics->input_dev->close = drv260x_close;
input_set_drvdata(haptics->input_dev, haptics);
input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE);
Expand Down

0 comments on commit 5a8a6b8

Please sign in to comment.