summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-03-21 10:30:33 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-05-07 11:24:02 -0300
commitc56d34a73ea3622fbc3f5a85140f2353f14b591c (patch)
treea2eed876ded1fc63afc231728dca17ada05b8c64 /drivers/media
parent47cae1e1cfdb6a07ca19c61345c4d96f828b14d7 (diff)
downloadop-kernel-dev-c56d34a73ea3622fbc3f5a85140f2353f14b591c.zip
op-kernel-dev-c56d34a73ea3622fbc3f5a85140f2353f14b591c.tar.gz
[media] drivers/media/media-device: move debug log before _devnode_unregister()
After media_devnode_unregister(), the struct media_device may be freed already, and dereferencing it may crash. Signed-off-by: Max Kellermann <max@duempel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/media-device.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 898a3cf..de92a6b 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -801,9 +801,8 @@ void media_device_unregister(struct media_device *mdev)
mutex_unlock(&mdev->graph_mutex);
device_remove_file(&mdev->devnode.dev, &dev_attr_model);
+ dev_dbg(mdev->dev, "Media device unregistering\n");
media_devnode_unregister(&mdev->devnode);
-
- dev_dbg(mdev->dev, "Media device unregistered\n");
}
EXPORT_SYMBOL_GPL(media_device_unregister);
OpenPOWER on IntegriCloud