From: Helen Fornazier Date: Thu, 6 Apr 2017 19:25:15 +0000 (-0300) Subject: [media] media-entity: only call dev_dbg_obj if mdev is not NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8d1d3d004c1c5386a0c7cf2e49b9de841ec4484b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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 */