From: Raphael Gallais-Pou Date: Thu, 17 Jul 2025 19:15:32 +0000 (+0200) Subject: drm/sti: check dma_set_coherent_mask return value X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76f396696efe702be3564a67f9d2136778f4713a;p=thirdparty%2Fkernel%2Flinux.git drm/sti: check dma_set_coherent_mask return value Return value for DMA allocation was not checked. Check it and return error code in case of failing. Signed-off-by: Raphael Gallais-Pou Acked-by: Alain Volmat Link: https://patch.msgid.link/20250717-sti-rework-v1-1-46d516fb1ebb@gmail.com Signed-off-by: Raphael Gallais-Pou --- diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 5e9332df21df0..42f21ab91957b 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -234,8 +234,11 @@ static int sti_platform_probe(struct platform_device *pdev) struct device_node *node = dev->of_node; struct device_node *child_np; struct component_match *match = NULL; + int ret; - dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); + if (ret) + return ret; devm_of_platform_populate(dev);