summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/drm_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/drm_dma.c')
-rw-r--r--sys/dev/pci/drm/drm_dma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_dma.c b/sys/dev/pci/drm/drm_dma.c
index 6b3ec78fc34..88334924a6f 100644
--- a/sys/dev/pci/drm/drm_dma.c
+++ b/sys/dev/pci/drm/drm_dma.c
@@ -68,8 +68,12 @@ drm_cleanup_buf(struct drm_device *dev, drm_buf_entry_t *entry)
}
if (entry->buf_count) {
+ for (i = 0; i < entry->buf_count; i++) {
+ drm_free(entry->buflist[i].dev_private,
+ dev->driver->buf_priv_size, DRM_MEM_BUFS);
+ }
drm_free(entry->buflist, entry->buf_count *
- dev->driver->buf_priv_size, DRM_MEM_BUFS);
+ sizeof(*entry->buflist), DRM_MEM_BUFS);
entry->buf_count = 0;
}