[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251002091844.11-1-alsp705@gmail.com>
Date: Thu, 2 Oct 2025 12:18:42 +0300
From: Alexandr Sapozhnkiov <alsp705@...il.com>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: Alexandr Sapozhnikov <alsp705@...il.com>,
lvc-project@...uxtesting.org
Subject: [PATCH v2] vgem: fix error return in vgem_init()
From: Alexandr Sapozhnikov <alsp705@...il.com>
The dma_coerce_mask_and_coherent function may
fail to apply a mask due to incorrectly passed parameters.
However, since this function returns the -EIO error,
this is an abnormal situation and the error should be logged.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandr Sapozhnikov <alsp705@...il.com>
---
drivers/gpu/drm/vgem/vgem_drv.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index c5e3e5457737..dc132dd44b9e 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -140,8 +140,10 @@ static int __init vgem_init(void)
goto out_unregister;
}
- dma_coerce_mask_and_coherent(&pdev->dev,
+ ret = dma_coerce_mask_and_coherent(&pdev->dev,
DMA_BIT_MASK(64));
+ if (ret)
+ goto out_unregister;
vgem_device = devm_drm_dev_alloc(&pdev->dev, &vgem_driver,
struct vgem_device, drm);
--
2.43.0
Powered by blists - more mailing lists