aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/media-entity.c
diff options
context:
space:
mode:
authorHelen Fornazier <helen.koike@collabora.com>2017-04-06 16:25:15 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-19 08:15:51 -0300
commit8d1d3d004c1c5386a0c7cf2e49b9de841ec4484b (patch)
tree691f65d5d9156b021e740a929e580adfbabdec4d /drivers/media/media-entity.c
parent242b0c4cc96f97d0a3b96343acd21613b63fa4a6 (diff)
download96b-common-8d1d3d004c1c5386a0c7cf2e49b9de841ec4484b.tar.gz
[media] media-entity: only call dev_dbg_obj if mdev is not NULL
Fix kernel Oops NULL pointer deference Call dev_dbg_obj only after checking if gobj->mdev is not NULL Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r--drivers/media/media-entity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 5640ca29da8c..bc44193efa47 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -199,12 +199,12 @@ void media_gobj_create(struct media_device *mdev,
void media_gobj_destroy(struct media_gobj *gobj)
{
- dev_dbg_obj(__func__, gobj);
-
/* Do nothing if the object is not linked. */
if (gobj->mdev == NULL)
return;
+ dev_dbg_obj(__func__, gobj);
+
gobj->mdev->topology_version++;
/* Remove the object from mdev list */