Message ID | 20230810184116.230831-1-airlied@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | nouveau/u_memcpya: use kvmalloc_array. | expand |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 54063b094a69..6661f3057b72 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -192,9 +192,7 @@ u_memcpya(uint64_t user, unsigned nmemb, unsigned size) void *mem; void __user *userptr = (void __force __user *)(uintptr_t)user; - size *= nmemb; - - mem = kvmalloc(size, GFP_KERNEL); + mem = kvmalloc_array(nmemb, size, GFP_KERNEL); if (!mem) return ERR_PTR(-ENOMEM);