Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 00b68a7

Browse files
tititiou36gregkh
authored andcommitted
media: venus: core: Fix some resource leaks in the error path of 'venus_probe()'
[ Upstream commit 5a465c5 ] If an error occurs after a successful 'of_icc_get()' call, it must be undone. Use 'devm_of_icc_get()' instead of 'of_icc_get()' to avoid the leak. Update the remove function accordingly and axe the now unneeded 'icc_put()' calls. Fixes: 32f0a6d ("media: venus: Use on-chip interconnect API") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0741a8f commit 00b68a7

File tree

1 file changed

+2
-5
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+2
-5
lines changed

drivers/media/platform/qcom/venus/core.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ static int venus_probe(struct platform_device *pdev)
195195
if (IS_ERR(core->base))
196196
return PTR_ERR(core->base);
197197

198-
core->video_path = of_icc_get(dev, "video-mem");
198+
core->video_path = devm_of_icc_get(dev, "video-mem");
199199
if (IS_ERR(core->video_path))
200200
return PTR_ERR(core->video_path);
201201

202-
core->cpucfg_path = of_icc_get(dev, "cpu-cfg");
202+
core->cpucfg_path = devm_of_icc_get(dev, "cpu-cfg");
203203
if (IS_ERR(core->cpucfg_path))
204204
return PTR_ERR(core->cpucfg_path);
205205

@@ -334,9 +334,6 @@ static int venus_remove(struct platform_device *pdev)
334334

335335
hfi_destroy(core);
336336

337-
icc_put(core->video_path);
338-
icc_put(core->cpucfg_path);
339-
340337
v4l2_device_unregister(&core->v4l2_dev);
341338
mutex_destroy(&core->pm_lock);
342339
mutex_destroy(&core->lock);

0 commit comments

Comments
 (0)