Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christophe JAILLET and committed by
Mauro Carvalho Chehab
310fda62 a5e9e202

+2 -2
+2 -2
drivers/media/platform/aspeed/aspeed-video.c
··· 1993 1993 1994 1994 rc = aspeed_video_setup_video(video); 1995 1995 if (rc) { 1996 + aspeed_video_free_buf(video, &video->jpeg); 1996 1997 clk_unprepare(video->vclk); 1997 1998 clk_unprepare(video->eclk); 1998 1999 return rc; ··· 2025 2024 2026 2025 v4l2_device_unregister(v4l2_dev); 2027 2026 2028 - dma_free_coherent(video->dev, VE_JPEG_HEADER_SIZE, video->jpeg.virt, 2029 - video->jpeg.dma); 2027 + aspeed_video_free_buf(video, &video->jpeg); 2030 2028 2031 2029 of_reserved_mem_device_release(dev); 2032 2030