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
parent
2f3ca3908f
commit
27e13b330d
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue