Skip to content

Commit

Permalink
HID: wacom: Release device resource data obtained by devres_alloc()
Browse files Browse the repository at this point in the history
Free device resource data, if __wacom_devm_sysfs_create_group
is not successful.

Signed-off-by: Arvind Yadav <[email protected]>
Reviewed-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
ArvindYadavCs authored and Jiri Kosina committed Apr 25, 2018
1 parent a230cd5 commit 097b8f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 097b8f6

Please sign in to comment.