summaryrefslogtreecommitdiffstats
path: root/drivers/media/media-entity.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2015-08-24 14:57:53 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:56 -0200
commita9709e435454cf84d8971261ff8ded3a453b9b13 (patch)
tree31e724850086f3a909640b6513a8ac7eeb0a636d /drivers/media/media-entity.c
parent7e9a8ad57c097b7fe7ed9ba514f78789363aa6b8 (diff)
downloadlinux-a9709e435454cf84d8971261ff8ded3a453b9b13.tar.bz2
[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>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r--drivers/media/media-entity.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index b1390d843909..d7243cb56c79 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -242,13 +242,6 @@ EXPORT_SYMBOL_GPL(media_entity_init);
void
media_entity_cleanup(struct media_entity *entity)
{
- struct media_link *link, *tmp;
-
- list_for_each_entry_safe(link, tmp, &entity->links, list) {
- media_gobj_remove(&link->graph_obj);
- list_del(&link->list);
- kfree(link);
- }
}
EXPORT_SYMBOL_GPL(media_entity_cleanup);