In media_device_register_entity, if media_graph_walk_init fails, need to free the previously memory.
Reported-by: Hulk Robot <hul...@huawei.com> Signed-off-by: zhengbin <zhengbi...@huawei.com> --- drivers/media/mc/mc-device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c index e19df51..939be00 100644 --- a/drivers/media/mc/mc-device.c +++ b/drivers/media/mc/mc-device.c @@ -632,6 +632,7 @@ int __must_check media_device_register_entity(struct media_device *mdev, */ ret = media_graph_walk_init(&new, mdev); if (ret) { + __media_device_unregister_entity(entity); mutex_unlock(&mdev->graph_mutex); return ret; } -- 2.7.4