Skip to content

Commit

Permalink
media: aspeed: Fix an error handling path in aspeed_video_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 310fda6 ]

A dma_free_coherent() call is missing in the error handling path of the
probe, as already done in the remove function.

In fact, this call is included in aspeed_video_free_buf(). So use the
latter both in the error handling path of the probe and in the remove
function.
It is easier to see the relation with aspeed_video_alloc_buf() this way.

Fixes: d2b4387 ("media: platform: Add Aspeed Video Engine driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tititiou36 authored and gregkh committed Jun 9, 2022
1 parent 34feaea commit 0572a5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/platform/aspeed-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@ static int aspeed_video_probe(struct platform_device *pdev)

rc = aspeed_video_setup_video(video);
if (rc) {
aspeed_video_free_buf(video, &video->jpeg);
clk_unprepare(video->vclk);
clk_unprepare(video->eclk);
return rc;
Expand All @@ -1748,8 +1749,7 @@ static int aspeed_video_remove(struct platform_device *pdev)

v4l2_device_unregister(v4l2_dev);

dma_free_coherent(video->dev, VE_JPEG_HEADER_SIZE, video->jpeg.virt,
video->jpeg.dma);
aspeed_video_free_buf(video, &video->jpeg);

of_reserved_mem_device_release(dev);

Expand Down

0 comments on commit 0572a5b

Please sign in to comment.