diff options
Diffstat (limited to 'sys/dev/pci/drm/savage_state.c')
-rw-r--r-- | sys/dev/pci/drm/savage_state.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/savage_state.c b/sys/dev/pci/drm/savage_state.c index 024cc46370e..25e1aeb6005 100644 --- a/sys/dev/pci/drm/savage_state.c +++ b/sys/dev/pci/drm/savage_state.c @@ -987,20 +987,20 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ * for locking on FreeBSD. */ if (cmdbuf->size) { - kcmd_addr = drm_calloc(cmdbuf->size, 8, DRM_MEM_DRIVER); + kcmd_addr = drm_calloc(cmdbuf->size, 8); if (kcmd_addr == NULL) return ENOMEM; if (DRM_COPY_FROM_USER(kcmd_addr, cmdbuf->cmd_addr, cmdbuf->size * 8)) { - drm_free(kcmd_addr, cmdbuf->size * 8, DRM_MEM_DRIVER); + drm_free(kcmd_addr); return EFAULT; } cmdbuf->cmd_addr = kcmd_addr; } if (cmdbuf->vb_size) { - kvb_addr = drm_alloc(cmdbuf->vb_size, DRM_MEM_DRIVER); + kvb_addr = drm_alloc(cmdbuf->vb_size); if (kvb_addr == NULL) { ret = ENOMEM; goto done; @@ -1014,8 +1014,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ cmdbuf->vb_addr = kvb_addr; } if (cmdbuf->nbox) { - kbox_addr = drm_calloc(cmdbuf->nbox, - sizeof(struct drm_clip_rect), DRM_MEM_DRIVER); + kbox_addr = drm_calloc(cmdbuf->nbox, sizeof(*kbox_addr)); if (kbox_addr == NULL) { ret = ENOMEM; goto done; @@ -1156,10 +1155,9 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ done: /* If we didn't need to allocate them, these'll be NULL */ - drm_free(kcmd_addr, cmdbuf->size * 8, DRM_MEM_DRIVER); - drm_free(kvb_addr, cmdbuf->vb_size, DRM_MEM_DRIVER); - drm_free(kbox_addr, cmdbuf->nbox * sizeof(struct drm_clip_rect), - DRM_MEM_DRIVER); + drm_free(kcmd_addr); + drm_free(kvb_addr); + drm_free(kbox_addr); return ret; } |