[PATCH] drm/exynos: fix compile error and warning of g2d

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Should be !g2d_userptr->vec, not !vec. This will fix below compile
error.

drivers/gpu/drm/exynos/exynos_drm_g2d.c: In function ‘g2d_userptr_get_dma_addr’:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:465:7: error: ‘vec’ undeclared (first use in this function)
  if (!vec)

Also, if g2d_userptr->vec is NULL it should assign -ENOMEM in ret. It
will fix below compile warning.

drivers/gpu/drm/exynos/exynos_drm_g2d.c: In function ‘exynos_g2d_set_cmdlist_ioctl’:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:415:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  int ret;
      ^
Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 810e1ee..7584834 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -462,8 +462,10 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,
 	end = PAGE_ALIGN(userptr + size);
 	npages = (end - start) >> PAGE_SHIFT;
 	g2d_userptr->vec = frame_vector_create(npages);
-	if (!vec)
+	if (!g2d_userptr->vec) {
+		ret = -ENOMEM;
 		goto err_free;
+	}
 
 	ret = get_vaddr_frames(start, npages, true, true, g2d_userptr->vec);
 	if (ret != npages) {
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux