]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
HID: input: fix leaking custom input node name
authorStefan Agner <stefan@agner.ch>
Tue, 28 Aug 2018 11:29:55 +0000 (13:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:41:20 +0000 (22:41 +0200)
commit e38c0ac55ee67cf3626cfbc2283f8873dc44d370 upstream.

Make sure to free the custom input node name on disconnect.

Cc: stable@vger.kernel.org # v4.18+
Fixes: c554bb045511 ("HID: input: append a suffix matching the application")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-input.c

index a137d2835f32876f262bd4cf2e0cf8170328cb44..b23c4b5854d8ba974ee6fa6331e51aebd4b14adb 100644 (file)
@@ -1812,6 +1812,7 @@ void hidinput_disconnect(struct hid_device *hid)
                        input_unregister_device(hidinput->input);
                else
                        input_free_device(hidinput->input);
+               kfree(hidinput->name);
                kfree(hidinput);
        }