diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-03-06 21:08:07 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-05-13 10:13:17 +0300 |
commit | 310fda622bbd38be17fb444f7f049b137af3bc0d (patch) | |
tree | d2ce1e76a1155ce8a6a34aaa86e8b585368fac20 /drivers/media/platform/aspeed/aspeed-video.c | |
parent | a5e9e202fe4c25ab6c57061d009a17a2369355bc (diff) | |
download | linux-310fda622bbd38be17fb444f7f049b137af3bc0d.tar.xz |
media: aspeed: Fix an error handling path in aspeed_video_probe()
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: d2b4387f3bdf ("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>
Diffstat (limited to 'drivers/media/platform/aspeed/aspeed-video.c')
-rw-r--r-- | drivers/media/platform/aspeed/aspeed-video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index b937dbcbe9e0..20f795ccc11b 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -1993,6 +1993,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; @@ -2024,8 +2025,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); |