projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3885f7
)
nouveau/u_memcpya: fix NULL vs error pointer bug
author
Dan Carpenter
<dan.carpenter@linaro.org>
Fri, 15 Sep 2023 12:59:21 +0000
(15:59 +0300)
committer
Danilo Krummrich
<dakr@redhat.com>
Tue, 19 Sep 2023 22:20:08 +0000
(
00:20
+0200)
The u_memcpya() function is supposed to return error pointers on
error. Returning NULL will lead to an Oops.
Fixes: e3885f712134 ("nouveau/u_memcpya: use vmemdup_user")
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link:
https://patchwork.freedesktop.org/patch/msgid/10fd258b-466f-4c5b-9d48-fe61a3f21424@moroto.mountain
drivers/gpu/drm/nouveau/nouveau_drv.h
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/nouveau/nouveau_drv.h
b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 3666a7403e472ae83912fdddb57b8ccb05079273..e73a233c6572322dbee898b8f6962cf6b386b23f 100644
(file)
--- a/
drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/
drivers/gpu/drm/nouveau/nouveau_drv.h
@@
-193,7
+193,7
@@
u_memcpya(uint64_t user, unsigned int nmemb, unsigned int size)
size_t bytes;
if (unlikely(check_mul_overflow(nmemb, size, &bytes)))
- return
NULL
;
+ return
ERR_PTR(-EOVERFLOW)
;
return vmemdup_user(userptr, bytes);
}