Skip to content

Commit

Permalink
media: siano: fix memory leak of debugfs members in smsdvb_hotplug
Browse files Browse the repository at this point in the history
[ Upstream commit abf287e ]

When dvb_create_media_graph fails, the debugfs kept inside client should
be released. However, the current implementation does not release them.

Fix this by adding a new goto label to call smsdvb_debugfs_release.

Fixes: 0d3ab84 ("[media] dvb core: must check dvb_create_media_graph()")
Signed-off-by: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
quasi-mod authored and gregkh committed Dec 30, 2020
1 parent bac43b0 commit 0736d6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/common/siano/smsdvb-main.c
Expand Up @@ -1169,12 +1169,15 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
rc = dvb_create_media_graph(&client->adapter, true);
if (rc < 0) {
pr_err("dvb_create_media_graph failed %d\n", rc);
goto client_error;
goto media_graph_error;
}

pr_info("DVB interface registered.\n");
return 0;

media_graph_error:
smsdvb_debugfs_release(client);

client_error:
dvb_unregister_frontend(&client->frontend);

Expand Down

0 comments on commit 0736d6a

Please sign in to comment.