FreeBSD/sys/dev/drm2/drm_bufs.c
/**
 * Cleanup after an error on one of the addbufs() functions.
 *
 * \param dev DRM device.
 * \param entry buffer entry where the error occurred.
 *
 * Frees any pages and buffers associated with the given entry.
 */
Cleanup after an error on one of the addbufs() functions.
\param dev DRM device.
\param entry buffer entry where the error occurred.

Frees any pages and buffers associated with the given entry.
Cleanup after an error on one of the addbufs () functions . \ param dev DRM device . \ param entry buffer entry where the error occurred . Frees any pages and buffers associated with the given entry .
static void drm_cleanup_buf_error(struct drm_device * dev,
				  struct drm_buf_entry * entry)
{
	int i;
	if (entry->seg_count) {
		for (i = 0; i < entry->seg_count; i++) {
			if (entry->seglist[i]) {
				drm_pci_free(dev, entry->seglist[i]);
			}
		}
		free(entry->seglist, DRM_MEM_SEGS);
		entry->seg_count = 0;
	}
	if (entry->buf_count) {
		for (i = 0; i < entry->buf_count; i++) {
			free(entry->buflist[i].dev_private, DRM_MEM_BUFS);
		}
		free(entry->buflist, DRM_MEM_BUFS);
		entry->buf_count = 0;
	}
}
static void drm_cleanup_buf_error ( struct drm_device * dev , struct drm_buf_entry * entry ) { int i ; if ( entry -> seg_count ) { for ( i = 0 ; i < entry -> seg_count ; i ++ ) { if ( entry -> seglist [ i ] ) { drm_pci_free ( dev , entry -> seglist [ i ] ) ; } } free ( entry -> seglist , DRM_MEM_SEGS ) ; entry -> seg_count = 0 ; } if ( entry -> buf_count ) { for ( i = 0 ; i < entry -> buf_count ; i ++ ) { free ( entry -> buflist [ i ] . dev_private , DRM_MEM_BUFS ) ; } free ( entry -> buflist , DRM_MEM_BUFS ) ; entry -> buf_count = 0 ; } }
Cleanup after an error on one of the addbufs() functions.
Cleanup after an error on one of the addbufs () functions .