[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 3 Mar 2023 11:16:24 +0000
From: harperchen <harperchen1110@...il.com>
To: mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
harperchen <harperchen1110@...il.com>
Subject: [PATCH] media: platform: via: Handle error for dma_set_mask
As the potential failure of the dma_set_mask(), we fix this
bug by checking its return value and performing proper error
handling.
Signed-off-by: harperchen <harperchen1110@...il.com>
---
drivers/media/platform/via/via-camera.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/via/via-camera.c b/drivers/media/platform/via/via-camera.c
index 95483c84c3f2..885917cff738 100644
--- a/drivers/media/platform/via/via-camera.c
+++ b/drivers/media/platform/via/via-camera.c
@@ -1208,7 +1208,9 @@ static int viacam_probe(struct platform_device *pdev)
* Convince the system that we can do DMA.
*/
pdev->dev.dma_mask = &viadev->pdev->dma_mask;
- dma_set_mask(&pdev->dev, 0xffffffff);
+ ret = dma_set_mask(&pdev->dev, 0xffffffff);
+ if (ret)
+ goto out_ctrl_hdl_free;
/*
* Fire up the capture port. The write to 0x78 looks purely
* OLPCish; any system will need to tweak 0x1e.
--
2.25.1
Powered by blists - more mailing lists