提交 a9709e43 编写于 作者: J Javier Martinez Canillas 提交者: Mauro Carvalho Chehab

[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: NJavier Martinez Canillas <javier@osg.samsung.com>
上级 7e9a8ad5
无相关合并请求
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部