]> git.baikalelectronics.ru Git - kernel.git/commit
[media] media: don't try to empty links list in media_entity_cleanup()
authorJavier Martinez Canillas <javier@osg.samsung.com>
Mon, 24 Aug 2015 17:57:53 +0000 (14:57 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:18:56 +0000 (12:18 -0200)
commit1d5dd1fbf98f53794368beccf676d04ed13024d6
tree31e724850086f3a909640b6513a8ac7eeb0a636d
parent46cfc30e68fb29aed3e74c36102291464a9f1819
[media] media: don't try to empty links list in media_entity_cleanup()

The media_entity_cleanup() function only cleans up the entity links list
but this operation is already made in media_device_unregister_entity().

In most cases this should be harmless (besides having duplicated code)
since the links list would be empty so the iteration would not happen
but the links list is initialized in media_device_register_entity() so
if a driver fails to register an entity with a media device and clean up
the entity in the error path, a NULL deference pointer error will happen.

So don't try to empty the links list in media_entity_cleanup() since
is either done already or haven't been initialized yet.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
drivers/media/media-entity.c