Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d1d3d00 authored by Helen Fornazier's avatar Helen Fornazier Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarHelen Koike <helen.koike@collabora.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 242b0c4c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 */