nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: use vmemdup_array_user() in u_memcpya()
@ 2024-04-15  9:54 Danilo Krummrich
  0 siblings, 0 replies; only message in thread
From: Danilo Krummrich @ 2024-04-15  9:54 UTC (permalink / raw)
  To: nouveau; +Cc: dri-devel, Danilo Krummrich

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

Signed-off-by: Danilo Krummrich <dakr@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


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

only message in thread, other threads:[~2024-04-15  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15  9:54 [PATCH] drm/nouveau: use vmemdup_array_user() in u_memcpya() Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).