summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2018-04-24 13:33:03 +0530
committerJiri Kosina <jkosina@suse.cz>2018-04-25 10:50:57 +0200
commit097b8f62dd793e08f1732fc74dbb64596c7fbff9 (patch)
treea1feb68bc995ba87a0dd8b72ff12a36676dde526 /drivers/hid
parenta230cd52b8a2be39cd6e9a13b3e62af57f21372a (diff)
downloadop-kernel-dev-097b8f62dd793e08f1732fc74dbb64596c7fbff9.zip
op-kernel-dev-097b8f62dd793e08f1732fc74dbb64596c7fbff9.tar.gz
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')
-rw-r--r--drivers/hid/wacom_sys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index b54ef1f..ee7a37e 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);
OpenPOWER on IntegriCloud