diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2018-04-24 13:33:03 +0530 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-04-25 10:50:57 +0200 |
commit | 097b8f62dd793e08f1732fc74dbb64596c7fbff9 (patch) | |
tree | a1feb68bc995ba87a0dd8b72ff12a36676dde526 /drivers/hid/wacom_sys.c | |
parent | a230cd52b8a2be39cd6e9a13b3e62af57f21372a (diff) |
HID: wacom: Release device resource data obtained by devres_alloc()
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>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-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 b54ef1ffcbec..ee7a37eb159a 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1213,8 +1213,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); |