Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361733 > unrolled thread

[PATCH] drivers/media/rc: postpone kfree(rc_dev)

Started byMax Kellermann <max@duempel.org>
First post2016-03-21 12:40 +0100
Last post2016-03-21 13:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers/media/rc: postpone kfree(rc_dev) Max Kellermann <max@duempel.org> - 2016-03-21 12:40 +0100
    Re: [PATCH] drivers/media/rc: postpone kfree(rc_dev) Max Kellermann <max@duempel.org> - 2016-03-21 13:30 +0100
    Re: [PATCH] drivers/media/rc: postpone kfree(rc_dev) Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-21 13:30 +0100

#1361733 — [PATCH] drivers/media/rc: postpone kfree(rc_dev)

FromMax Kellermann <max@duempel.org>
Date2016-03-21 12:40 +0100
Subject[PATCH] drivers/media/rc: postpone kfree(rc_dev)
Message-ID<rf6lI-4Vp-9@gated-at.bofh.it>
CONFIG_DEBUG_KOBJECT_RELEASE found this bug.
---
 drivers/media/rc/rc-main.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 1042fa3..cb3e8db 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1248,6 +1248,9 @@ unlock:
 
 static void rc_dev_release(struct device *device)
 {
+	struct rc_dev *dev = to_rc_dev(device);
+
+	kfree(dev);
 }
 
 #define ADD_HOTPLUG_VAR(fmt, val...)					\
@@ -1369,7 +1372,9 @@ void rc_free_device(struct rc_dev *dev)
 
 	put_device(&dev->dev);
 
-	kfree(dev);
+	/* kfree(dev) will be called by the callback function
+	   rc_dev_release() */
+
 	module_put(THIS_MODULE);
 }
 EXPORT_SYMBOL_GPL(rc_free_device);

[toc] | [next] | [standalone]


#1361771

FromMax Kellermann <max@duempel.org>
Date2016-03-21 13:30 +0100
Message-ID<rf786-5yn-23@gated-at.bofh.it>
In reply to#1361733
On 2016/03/21 13:24, Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote:
> Please, always send us your Signed-off-by on your patches, as described at:
> 	https://linuxtv.org/wiki/index.php/Development:_Submitting_Patches#Developer.27s_Certificate_of_Origin_1.1

Sorry, I forgot this, and remembered only right after the patches were
already sent.  I will resend.

Max

[toc] | [prev] | [next] | [standalone]


#1361781

FromMauro Carvalho Chehab <mchehab@osg.samsung.com>
Date2016-03-21 13:30 +0100
Message-ID<rf786-5yn-25@gated-at.bofh.it>
In reply to#1361733
Hi Max,

Em Mon, 21 Mar 2016 12:33:05 +0100
Max Kellermann <max@duempel.org> escreveu:

> CONFIG_DEBUG_KOBJECT_RELEASE found this bug.

Please, always send us your Signed-off-by on your patches, as described at:
	https://linuxtv.org/wiki/index.php/Development:_Submitting_Patches#Developer.27s_Certificate_of_Origin_1.1



> ---
>  drivers/media/rc/rc-main.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
> index 1042fa3..cb3e8db 100644
> --- a/drivers/media/rc/rc-main.c
> +++ b/drivers/media/rc/rc-main.c
> @@ -1248,6 +1248,9 @@ unlock:
>  
>  static void rc_dev_release(struct device *device)
>  {
> +	struct rc_dev *dev = to_rc_dev(device);
> +
> +	kfree(dev);
>  }
>  
>  #define ADD_HOTPLUG_VAR(fmt, val...)					\
> @@ -1369,7 +1372,9 @@ void rc_free_device(struct rc_dev *dev)
>  
>  	put_device(&dev->dev);
>  
> -	kfree(dev);
> +	/* kfree(dev) will be called by the callback function
> +	   rc_dev_release() */
> +
>  	module_put(THIS_MODULE);
>  }
>  EXPORT_SYMBOL_GPL(rc_free_device);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Thanks,
Mauro

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web