diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2018-04-24 13:33:03 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-21 04:02:48 +0900 |
commit | 27e13b330dd2dae63b41855640d2b70517bd67e1 (patch) | |
tree | c95385254453eec84e53d976f6c85faa2f9a14b9 /drivers/hid | |
parent | 2f3ca3908fc06af250172cf08210778cfecb66aa (diff) | |
download | linux-stable-27e13b330dd2dae63b41855640d2b70517bd67e1.tar.gz linux-stable-27e13b330dd2dae63b41855640d2b70517bd67e1.tar.bz2 linux-stable-27e13b330dd2dae63b41855640d2b70517bd67e1.zip |
HID: wacom: Release device resource data obtained by devres_alloc()
[ Upstream commit 097b8f62dd793e08f1732fc74dbb64596c7fbff9 ]
Free device resource data, if __wacom_devm_sysfs_create_group
is not successful.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/wacom_sys.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 4c337585479e..69afd7968d9c 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1102,8 +1102,10 @@ static int __wacom_devm_sysfs_create_group(struct wacom *wacom, devres->root = root; error = sysfs_create_group(devres->root, group); - if (error) + if (error) { + devres_free(devres); return error; + } devres_add(&wacom->hdev->dev, devres); |