From: Arvind Yadav Date: Tue, 24 Apr 2018 08:03:03 +0000 (+0530) Subject: HID: wacom: Release device resource data obtained by devres_alloc() X-Git-Tag: v4.14.51~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27e13b330dd2dae63b41855640d2b70517bd67e1;p=platform%2Fkernel%2Flinux-rpi.git HID: wacom: Release device resource data obtained by devres_alloc() [ Upstream commit 097b8f62dd793e08f1732fc74dbb64596c7fbff9 ] Free device resource data, if __wacom_devm_sysfs_create_group is not successful. Signed-off-by: Arvind Yadav Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 4c33758..69afd79 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -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);