spin_lock(&atm_dev_lock); 
down(&atm_dev_mutex); 
struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,				 int number, unsigned long *flags){	struct atm_dev *dev, *inuse;	dev = __alloc_atm_dev(type);	if (!dev) {		printk(KERN_ERR "atm_dev_register: no space for dev %s\n",		    type);		return NULL;	}	spin_lock(&atm_dev_lock);	if (number != -1) {		if ((inuse = __atm_dev_lookup(number))) {			atm_dev_put(inuse);			spin_unlock(&atm_dev_lock);			kfree(dev);			return NULL;		}		dev->number = number;	} else {		dev->number = 0;		while ((inuse = __atm_dev_lookup(dev->number))) {			atm_dev_put(inuse);			dev->number++;		}	}	dev->ops = ops;	if (flags)		dev->flags = *flags;	else		memset(&dev->flags, 0, sizeof(dev->flags));	memset(&dev->stats, 0, sizeof(dev->stats));	atomic_set(&dev->refcnt, 1);	list_add_tail(&dev->dev_list, &atm_devs);	spin_unlock(&atm_dev_lock);	if (atm_proc_dev_register(dev) < 0) {		printk(KERN_ERR "atm_dev_register: "		       "atm_proc_dev_register failed for dev %s\n",		       type);		spin_lock(&atm_dev_lock);		list_del(&dev->dev_list);		spin_unlock(&atm_dev_lock);		kfree(dev);		return NULL;	}	return dev;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/aaaaaadbe7a663d110814db50fcbe7d320eb4c32/resources.c/buggy/net/atm/resources.c