if (dev_count > DIM(dev_self)) { 
if (dev_count >= ARRAY_SIZE(dev_self)) { 
static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq){	struct smsc_ircc_cb *self;	struct net_device *dev;	int err;	IRDA_DEBUG(1, "%s\n", __FUNCTION__);	err = smsc_ircc_present(fir_base, sir_base);	if (err)		goto err_out;	err = -ENOMEM;	if (dev_count > DIM(dev_self)) {	        IRDA_WARNING("%s(), too many devices!\n", __FUNCTION__);		goto err_out1;	}	/*	 *  Allocate new instance of the driver	 */	dev = alloc_irdadev(sizeof(struct smsc_ircc_cb));	if (!dev) {		IRDA_WARNING("%s() can't allocate net device\n", __FUNCTION__);		goto err_out1;	}	SET_MODULE_OWNER(dev);	dev->hard_start_xmit = smsc_ircc_hard_xmit_sir;#if SMSC_IRCC2_C_NET_TIMEOUT	dev->tx_timeout	     = smsc_ircc_timeout;	dev->watchdog_timeo  = HZ * 2;  /* Allow enough time for speed change */#endif	dev->open            = smsc_ircc_net_open;	dev->stop            = smsc_ircc_net_close;	dev->do_ioctl        = smsc_ircc_net_ioctl;	dev->get_stats	     = smsc_ircc_net_get_stats;	self = dev->priv;	self->netdev = dev;	/* Make ifconfig display some details */	dev->base_addr = self->io.fir_base = fir_base;	dev->irq = self->io.irq = irq;	/* Need to store self somewhere */	dev_self[dev_count++] = self;	spin_lock_init(&self->lock);	self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE;	self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE;	self->rx_buff.head =		dma_alloc_coherent(NULL, self->rx_buff.truesize,				   &self->rx_buff_dma, GFP_KERNEL);	if (self->rx_buff.head == NULL) {		IRDA_ERROR("%s, Can't allocate memory for receive buffer!\n",			   driver_name);		goto err_out2;	}	self->tx_buff.head =		dma_alloc_coherent(NULL, self->tx_buff.truesize,				   &self->tx_buff_dma, GFP_KERNEL);	if (self->tx_buff.head == NULL) {		IRDA_ERROR("%s, Can't allocate memory for transmit buffer!\n",			   driver_name);		goto err_out3;	}	memset(self->rx_buff.head, 0, self->rx_buff.truesize);	memset(self->tx_buff.head, 0, self->tx_buff.truesize);	self->rx_buff.in_frame = FALSE;	self->rx_buff.state = OUTSIDE_FRAME;	self->tx_buff.data = self->tx_buff.head;	self->rx_buff.data = self->rx_buff.head;	smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq);	smsc_ircc_setup_qos(self);	smsc_ircc_init_chip(self);	if (ircc_transceiver > 0  &&	    ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS)		self->transceiver = ircc_transceiver;	else		smsc_ircc_probe_transceiver(self);	err = register_netdev(self->netdev);	if (err) {		IRDA_ERROR("%s, Network device registration failed!\n",			   driver_name);		goto err_out4;	}	self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, smsc_ircc_pmproc);	if (self->pmdev)		self->pmdev->data = self;	IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name);	return 0; err_out4:	dma_free_coherent(NULL, self->tx_buff.truesize,			  self->tx_buff.head, self->tx_buff_dma); err_out3:	dma_free_coherent(NULL, self->rx_buff.truesize,			  self->rx_buff.head, self->rx_buff_dma); err_out2:	free_netdev(self->netdev);	dev_self[--dev_count] = NULL; err_out1:	release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT);	release_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT); err_out:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a956f4ca3ede0a77e307f504e4a98554047b44ff/smsc-ircc2.c/buggy/drivers/net/irda/smsc-ircc2.c