mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: platform: via: Handle error for dma_set_mask
@ 2023-03-03 11:16 harperchen
  0 siblings, 0 replies; only message in thread
From: harperchen @ 2023-03-03 11:16 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media, linux-kernel, harperchen

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@gmail.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-03 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 11:16 [PATCH] media: platform: via: Handle error for dma_set_mask harperchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®