diff options
author | Max Kellermann <max@duempel.org> | 2016-03-21 08:33:05 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-05-07 11:21:04 -0300 |
commit | 47cae1e1cfdb6a07ca19c61345c4d96f828b14d7 (patch) | |
tree | 7c1c3ae353d94347447995e43f4b7eb71e40cf82 /drivers/media/rc/rc-main.c | |
parent | acc37e8f86a8f2a3e1d1dc97d99b7625ccc95424 (diff) | |
download | lwn-47cae1e1cfdb6a07ca19c61345c4d96f828b14d7.tar.gz lwn-47cae1e1cfdb6a07ca19c61345c4d96f828b14d7.zip |
[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>
Diffstat (limited to 'drivers/media/rc/rc-main.c')
-rw-r--r-- | drivers/media/rc/rc-main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 68541b1e3bcb..7dfc7c2188f0 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -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); |