Skip to content

Commit cc71d37

Browse files
dtorJiri Kosina
authored andcommitted
HID: vivaldi: fix sysfs attributes leak
The driver creates the top row map sysfs attribute in input_configured() method; unfortunately we do not have a callback that is executed when HID interface is unbound, thus we are leaking these sysfs attributes, for example when device is disconnected. To fix it let's switch to managed version of adding sysfs attributes which will ensure that they are destroyed when the driver is unbound. Fixes: 14c9c01 ("HID: add vivaldi HID driver") Signed-off-by: Dmitry Torokhov <[email protected]> Tested-by: Stephen Boyd <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent fc3ef2e commit cc71d37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-vivaldi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void vivaldi_feature_mapping(struct hid_device *hdev,
144144
static int vivaldi_input_configured(struct hid_device *hdev,
145145
struct hid_input *hidinput)
146146
{
147-
return sysfs_create_group(&hdev->dev.kobj, &input_attribute_group);
147+
return devm_device_add_group(&hdev->dev, &input_attribute_group);
148148
}
149149

150150
static const struct hid_device_id vivaldi_table[] = {

0 commit comments

Comments
 (0)