 dev->maplist = drm_alloc(sizeof(*dev->maplist), DRM_MEM_MAPS); if(dev->maplist == NULL) return -ENOMEM; memset(dev->maplist, 0, sizeof(*dev->maplist)); INIT_LIST_HEAD(&dev->maplist->head); 
static int drm_setup( drm_device_t *dev ){	int i;	int ret;	if (dev->driver->presetup)	{		ret=dev->driver->presetup(dev);		if (ret!=0) 			return ret;	}	atomic_set( &dev->ioctl_count, 0 );	atomic_set( &dev->vma_count, 0 );	dev->buf_use = 0;	atomic_set( &dev->buf_alloc, 0 );	if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))	{		i = drm_dma_setup( dev );		if ( i < 0 )			return i;	}	for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )		atomic_set( &dev->counts[i], 0 );	for ( i = 0 ; i < DRM_HASH_SIZE ; i++ ) {		dev->magiclist[i].head = NULL;		dev->magiclist[i].tail = NULL;	}	dev->maplist = drm_alloc(sizeof(*dev->maplist),				  DRM_MEM_MAPS);	if(dev->maplist == NULL) return -ENOMEM;	memset(dev->maplist, 0, sizeof(*dev->maplist));	INIT_LIST_HEAD(&dev->maplist->head);	dev->ctxlist = drm_alloc(sizeof(*dev->ctxlist),				  DRM_MEM_CTXLIST);	if(dev->ctxlist == NULL) return -ENOMEM;	memset(dev->ctxlist, 0, sizeof(*dev->ctxlist));	INIT_LIST_HEAD(&dev->ctxlist->head);	dev->vmalist = NULL;	dev->sigdata.lock = dev->lock.hw_lock = NULL;	init_waitqueue_head( &dev->lock.lock_queue );	dev->queue_count = 0;	dev->queue_reserved = 0;	dev->queue_slots = 0;	dev->queuelist = NULL;	dev->irq_enabled = 0;	dev->context_flag = 0;	dev->interrupt_flag = 0;	dev->dma_flag = 0;	dev->last_context = 0;	dev->last_switch = 0;	dev->last_checked = 0;	init_waitqueue_head( &dev->context_wait );	dev->if_version = 0;	dev->ctx_start = 0;	dev->lck_start = 0;	dev->buf_rp = dev->buf;	dev->buf_wp = dev->buf;	dev->buf_end = dev->buf + DRM_BSZ;	dev->buf_async = NULL;	init_waitqueue_head( &dev->buf_readers );	init_waitqueue_head( &dev->buf_writers );	DRM_DEBUG( "\n" );	/*	 * The kernel's context could be created here, but is now created	 * in drm_dma_enqueue.	This is more resource-efficient for	 * hardware that does not do DMA, but may mean that	 * drm_select_queue fails between the time the interrupt is	 * initialized and the time the queues are initialized.	 */	if (dev->driver->postsetup)		dev->driver->postsetup(dev);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/836cf0465c422ee6d654060edd7c620d9cf0c09c/drm_fops.c/buggy/drivers/char/drm/drm_fops.c