How about
static struct atm_dev *alloc_atm_dev(const char *type)
{
struct atm_dev *dev;
dev = kmalloc(sizeof(*dev),GFP_KERNEL);
if (!dev) return NULL;
memset(dev,0,sizeof(*dev));
dev->type = type;
dev->signal = ATM_PHY_SIG_UNKNOWN;
dev->link_rate = ATM_OC3_PCR;
dev->next = NULL;
spin_lock(&atm_dev_lock);
dev->prev = last_dev;
if (atm_devs) last_dev->next = dev;
else atm_devs = dev;
last_dev = dev;
spin_unlock(&atm_dev_lock);
return dev;
}
instead. That seems to fix alloc_atm_dev safely. Refcounting wants adding
to atm_dev objects too, its impossible currently to make atm_find_dev
remotely safe
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/