You can make AddMap simpler by using a stack based drm_map_t and then allocating the real one at the end. It lets you remove all of the drm_free(map, sizeof(*map), DRM_MEM_MAPS);
This should be done at the very end after all of the error returns: if (drm_core_has_MTRR(dev)) { if (map->type == _DRM_FRAME_BUFFER || (map->flags & _DRM_WRITE_COMBINING)) { map->mtrr = mtrr_add(map->offset, map->size, MTRR_TYPE_WRCOMB, 1); } } ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel