LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] HID: wacom: Release device resource data obtained by devres_alloc()
@ 2018-04-24  8:03 Arvind Yadav
  2018-04-24  9:04 ` Benjamin Tissoires
  2018-04-25  8:51 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2018-04-24  8:03 UTC (permalink / raw)
  To: jikos, benjamin.tissoires, jkosina; +Cc: linux-kernel, linux-input

Free device resource data, if __wacom_devm_sysfs_create_group
is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/hid/wacom_sys.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index b54ef1f..ee7a37e 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -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);
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: wacom: Release device resource data obtained by devres_alloc()
  2018-04-24  8:03 [PATCH] HID: wacom: Release device resource data obtained by devres_alloc() Arvind Yadav
@ 2018-04-24  9:04 ` Benjamin Tissoires
  2018-04-25  8:51 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Tissoires @ 2018-04-24  9:04 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: Jiri Kosina, jkosina, lkml, open list:HID CORE LAYER

On Tue, Apr 24, 2018 at 10:03 AM, Arvind Yadav
<arvind.yadav.cs@gmail.com> wrote:
> Free device resource data, if __wacom_devm_sysfs_create_group
> is not successful.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---

Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>  drivers/hid/wacom_sys.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index b54ef1f..ee7a37e 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -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);
>
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: wacom: Release device resource data obtained by devres_alloc()
  2018-04-24  8:03 [PATCH] HID: wacom: Release device resource data obtained by devres_alloc() Arvind Yadav
  2018-04-24  9:04 ` Benjamin Tissoires
@ 2018-04-25  8:51 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2018-04-25  8:51 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: benjamin.tissoires, linux-kernel, linux-input

On Tue, 24 Apr 2018, Arvind Yadav wrote:

> Free device resource data, if __wacom_devm_sysfs_create_group
> is not successful.

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-25  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24  8:03 [PATCH] HID: wacom: Release device resource data obtained by devres_alloc() Arvind Yadav
2018-04-24  9:04 ` Benjamin Tissoires
2018-04-25  8:51 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).