projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
drm: Prevent drm_copy_field() to attempt copying a NULL pointer
[linux-2.6-microblaze.git]
/
drivers
/
gpu
/
drm
/
drm_ioctl.c
diff --git
a/drivers/gpu/drm/drm_ioctl.c
b/drivers/gpu/drm/drm_ioctl.c
index
e1b9a03
..
ca2a6e6
100644
(file)
--- a/
drivers/gpu/drm/drm_ioctl.c
+++ b/
drivers/gpu/drm/drm_ioctl.c
@@
-474,6
+474,12
@@
static int drm_copy_field(char __user *buf, size_t *buf_len, const char *value)
{
size_t len;
+ /* don't attempt to copy a NULL pointer */
+ if (WARN_ONCE(!value, "BUG: the value to copy was not set!")) {
+ *buf_len = 0;
+ return 0;
+ }
+
/* don't overflow userbuf */
len = strlen(value);
if (len > *buf_len)