summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c
index b90fc020..d1a88c88 100644
--- a/linux-core/drm_memory.c
+++ b/linux-core/drm_memory.c
@@ -183,7 +183,7 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area)
if (!(pt = kmalloc(size, GFP_KERNEL)))
return NULL;
if (oldpt && oldsize) {
- memcpy(pt, oldpt, oldsize);
+ memcpy(pt, oldpt, DRM_MIN(oldsize,size));
kfree(oldpt);
}
return pt;