Switch all instances of malloc/free in the DRM to drm_alloc, drm_free
authoroga <oga@openbsd.org>
Tue, 29 Jul 2008 19:44:13 +0000 (19:44 +0000)
committeroga <oga@openbsd.org>
Tue, 29 Jul 2008 19:44:13 +0000 (19:44 +0000)
commitf81a8921f7efd2dd19a840236e2e71b0289384f4
tree18bcad4d38d906e09981c7998f8438fa2cb4babb
parent998e1ccf0ceb9fdefcae44f41704df9beac9280c
Switch all instances of malloc/free in the DRM to drm_alloc, drm_free
and drm_calloc.

With the recent change to check overflow in drm_calloc, this means that
all allocations that require multiplication are now checked. Also use
drm_calloc() when zeroing is needed and drop the bzero/memset
afterwards.  Finally, make drm_free() check for NULL, so we don't need
to do so every time.

ok miod@, deraadt@
22 files changed:
sys/dev/pci/drm/drmP.h
sys/dev/pci/drm/drm_agpsupport.c
sys/dev/pci/drm/drm_auth.c
sys/dev/pci/drm/drm_bufs.c
sys/dev/pci/drm/drm_context.c
sys/dev/pci/drm/drm_dma.c
sys/dev/pci/drm/drm_drawable.c
sys/dev/pci/drm/drm_drv.c
sys/dev/pci/drm/drm_fops.c
sys/dev/pci/drm/drm_ioctl.c
sys/dev/pci/drm/drm_irq.c
sys/dev/pci/drm/drm_memory.c
sys/dev/pci/drm/drm_pci.c
sys/dev/pci/drm/drm_scatter.c
sys/dev/pci/drm/i915_dma.c
sys/dev/pci/drm/mach64_dma.c
sys/dev/pci/drm/mga_dma.c
sys/dev/pci/drm/r128_cce.c
sys/dev/pci/drm/radeon_cp.c
sys/dev/pci/drm/radeon_mem.c
sys/dev/pci/drm/savage_bci.c
sys/dev/pci/drm/savage_state.c