diff options
author | rnoland <rnoland@FreeBSD.org> | 2008-10-13 18:03:27 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2008-10-13 18:03:27 +0000 |
commit | 192b3600be5db1effa54d2e72717a7482aaeb52a (patch) | |
tree | 9afb72dec01dcbe8a080c5adf1bdbdde1abd41bd /sys/dev/drm/drm_ioctl.c | |
parent | 0d37976f3d86d7805a29299cc21e4b517b824aac (diff) | |
download | FreeBSD-src-192b3600be5db1effa54d2e72717a7482aaeb52a.zip FreeBSD-src-192b3600be5db1effa54d2e72717a7482aaeb52a.tar.gz |
Rework memory allocation to allocate memory with different type names. This
will ease the identification of memory leaks as the OS will be able to track
allocations for us by malloc type. vmstat -m will show all of the
allocations.
Convert the calls to drm_alloc() and friends, which are used in shared code
to static __inline__ while we are here.
Approved by: jhb (mentor)
Diffstat (limited to 'sys/dev/drm/drm_ioctl.c')
-rw-r--r-- | sys/dev/drm/drm_ioctl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/drm/drm_ioctl.c b/sys/dev/drm/drm_ioctl.c index c919b68..b23c45a 100644 --- a/sys/dev/drm/drm_ioctl.c +++ b/sys/dev/drm/drm_ioctl.c @@ -72,12 +72,12 @@ int drm_setunique(struct drm_device *dev, void *data, if (!u->unique_len || u->unique_len > 1024) return EINVAL; - busid = malloc(u->unique_len + 1, M_DRM, M_WAITOK); + busid = malloc(u->unique_len + 1, DRM_MEM_DRIVER, M_WAITOK); if (busid == NULL) return ENOMEM; if (DRM_COPY_FROM_USER(busid, u->unique, u->unique_len)) { - free(busid, M_DRM); + free(busid, DRM_MEM_DRIVER); return EFAULT; } busid[u->unique_len] = '\0'; @@ -87,7 +87,7 @@ int drm_setunique(struct drm_device *dev, void *data, */ ret = sscanf(busid, "PCI:%d:%d:%d", &bus, &slot, &func); if (ret != 3) { - free(busid, M_DRM); + free(busid, DRM_MEM_DRIVER); return EINVAL; } domain = bus >> 8; @@ -97,7 +97,7 @@ int drm_setunique(struct drm_device *dev, void *data, (bus != dev->pci_bus) || (slot != dev->pci_slot) || (func != dev->pci_func)) { - free(busid, M_DRM); + free(busid, DRM_MEM_DRIVER); return EINVAL; } @@ -128,7 +128,7 @@ drm_set_busid(struct drm_device *dev) } dev->unique_len = 20; - dev->unique = malloc(dev->unique_len + 1, M_DRM, M_NOWAIT); + dev->unique = malloc(dev->unique_len + 1, DRM_MEM_DRIVER, M_NOWAIT); if (dev->unique == NULL) { DRM_UNLOCK(); return ENOMEM; |