Commit 27e13b33 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

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

[ Upstream commit 097b8f62 ]

Free device resource data, if __wacom_devm_sysfs_create_group
is not successful.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f3ca390
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment