} 
} 
int drm_addmap_ioctl(struct inode *inode, struct file *filp,		     unsigned int cmd, unsigned long arg){	drm_file_t *priv = filp->private_data;	drm_device_t *dev = priv->head->dev;	drm_map_t map;	drm_map_t *map_ptr;	drm_map_t __user *argp = (void __user *)arg;	int err;	unsigned long handle = 0;	if (!(filp->f_mode & 3))		return -EACCES;	/* Require read/write */	if (copy_from_user(& map, argp, sizeof(map))) {		return -EFAULT;	}	err = drm_addmap(dev, map.offset, map.size, map.type, map.flags,			 &map_ptr);	if (err) {		return err;	}	{		drm_map_list_t *_entry;		list_for_each_entry(_entry, &dev->maplist->head, head) {			if (_entry->map == map_ptr)				handle = _entry->user_token;		}		if (!handle)			return -EFAULT;	}	if (copy_to_user(argp, map_ptr, sizeof(*map_ptr)))		return -EFAULT;	if (put_user(handle, &argp->handle))		return -EFAULT;	return 0;	}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/88f399cd0a5a540db2815eee3002f8f00ef6461e/drm_bufs.c/buggy/drivers/char/drm/drm_bufs.c