[PATCH] drm/nouveau: use vmemdup_array_user() in u_memcpya()

Danilo Krummrich dakr at redhat.com
Mon Apr 15 09:54:09 UTC 2024


Now that we have vmemdup_array_user(), make use of it.

Signed-off-by: Danilo Krummrich <dakr at redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_drv.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index e239c6bf4afa..2038d60958e3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -190,11 +190,8 @@ static inline void *
 u_memcpya(uint64_t user, unsigned int nmemb, unsigned int size)
 {
 	void __user *userptr = u64_to_user_ptr(user);
-	size_t bytes;
 
-	if (unlikely(check_mul_overflow(nmemb, size, &bytes)))
-		return ERR_PTR(-EOVERFLOW);
-	return vmemdup_user(userptr, bytes);
+	return vmemdup_array_user(userptr, nmemb, size);
 }
 
 #include <nvif/object.h>

base-commit: a57e191ebbaa0363dbf352cc37447c2230573e29
prerequisite-patch-id: d18b2d6615c58084a7027f4f1d9b51bd3f9dd83f
-- 
2.44.0



More information about the Nouveau mailing list