1
0
Fork 0

HID: wacom: Release device resource data obtained by devres_alloc()

[ Upstream commit 097b8f62dd ]

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>
pull/10/head
Arvind Yadav 2018-04-24 13:33:03 +05:30 committed by Greg Kroah-Hartman
parent 2f3ca3908f
commit 27e13b330d
1 changed files with 3 additions and 1 deletions

View File

@ -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);