linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/media/rc: postpone kfree(rc_dev)
@ 2016-03-21 12:26 Max Kellermann
  0 siblings, 0 replies; 4+ messages in thread
From: Max Kellermann @ 2016-03-21 12:26 UTC (permalink / raw)
  To: linux-kernel, linux-media

CONFIG_DEBUG_KOBJECT_RELEASE found this bug.

Signed-off-by: Max Kellermann <max@duempel.org>
---
 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);


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

* Re: [PATCH] drivers/media/rc: postpone kfree(rc_dev)
  2016-03-21 12:24 ` Mauro Carvalho Chehab
@ 2016-03-21 12:26   ` Max Kellermann
  0 siblings, 0 replies; 4+ messages in thread
From: Max Kellermann @ 2016-03-21 12:26 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-kernel, linux-media

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

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

* Re: [PATCH] drivers/media/rc: postpone kfree(rc_dev)
  2016-03-21 11:33 Max Kellermann
@ 2016-03-21 12:24 ` Mauro Carvalho Chehab
  2016-03-21 12:26   ` Max Kellermann
  0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-21 12:24 UTC (permalink / raw)
  To: Max Kellermann; +Cc: linux-kernel, linux-media

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

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

* [PATCH] drivers/media/rc: postpone kfree(rc_dev)
@ 2016-03-21 11:33 Max Kellermann
  2016-03-21 12:24 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 4+ messages in thread
From: Max Kellermann @ 2016-03-21 11:33 UTC (permalink / raw)
  To: linux-kernel, linux-media

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);


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

end of thread, other threads:[~2016-03-21 12:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 12:26 [PATCH] drivers/media/rc: postpone kfree(rc_dev) Max Kellermann
  -- strict thread matches above, loose matches on Subject: below --
2016-03-21 11:33 Max Kellermann
2016-03-21 12:24 ` Mauro Carvalho Chehab
2016-03-21 12:26   ` Max Kellermann

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).