mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
UPSTREAM: [media] drivers/media/rc: postpone kfree(rc_dev)
CONFIG_DEBUG_KOBJECT_RELEASE found this bug.
Signed-off-by: Max Kellermann <max@duempel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 47cae1e1cf)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
committed by
Tao Huang
parent
94b0e005ff
commit
4977084198
@@ -1263,6 +1263,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...) \
|
||||
@@ -1384,7 +1387,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);
|
||||
|
||||
Reference in New Issue
Block a user