summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/drm_memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_memory.c b/sys/dev/pci/drm/drm_memory.c
index 91828111eec..81dc4a10e98 100644
--- a/sys/dev/pci/drm/drm_memory.c
+++ b/sys/dev/pci/drm/drm_memory.c
@@ -72,7 +72,7 @@ drm_realloc(void *oldpt, size_t oldsize, size_t size, int area)
if (pt == NULL)
return NULL;
if (oldpt && oldsize) {
- memcpy(pt, oldpt, oldsize);
+ memcpy(pt, oldpt, min(oldsize, size));
free(oldpt, M_DRM);
}
return pt;