 if (cmdlog && !priv->cmdlog) { priv->cmdlog = kmalloc(sizeof(*priv->cmdlog) * cmdlog, GFP_KERNEL); if (priv->cmdlog == NULL) { IPW_ERROR("Error allocating %d command log entries.\n", cmdlog); } else { memset(priv->cmdlog, 0, sizeof(*priv->cmdlog) * cmdlog); priv->cmdlog_len = cmdlog; } } 
static int ipw_up(struct ipw_priv *priv){	int rc, i, j;	if (priv->status & STATUS_EXIT_PENDING)		return -EIO;	for (i = 0; i < MAX_HW_RESTARTS; i++) {		/* Load the microcode, firmware, and eeprom.		 * Also start the clocks. */		rc = ipw_load(priv);		if (rc) {			IPW_ERROR("Unable to load firmware: 0x%08X\n", rc);			return rc;		}		ipw_init_ordinals(priv);		if (!(priv->config & CFG_CUSTOM_MAC))			eeprom_parse_mac(priv, priv->mac_addr);		memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN);		for (j = 0; j < ARRAY_SIZE(ipw_geos); j++) {			if (!memcmp(&priv->eeprom[EEPROM_COUNTRY_CODE],				    ipw_geos[j].name, 3))				break;		}		if (j == ARRAY_SIZE(ipw_geos))			j = 0;		if (ieee80211_set_geo(priv->ieee, &ipw_geos[j])) {			IPW_WARNING("Could not set geography.");			return 0;		}		IPW_DEBUG_INFO("Geography %03d [%s] detected.\n",			       j, priv->ieee->geo.name);		if (priv->status & STATUS_RF_KILL_SW) {			IPW_WARNING("Radio disabled by module parameter.\n");			return 0;		} else if (rf_kill_active(priv)) {			IPW_WARNING("Radio Frequency Kill Switch is On:\n"				    "Kill switch must be turned off for "				    "wireless networking to work.\n");			queue_delayed_work(priv->workqueue, &priv->rf_kill,					   2 * HZ);			return 0;		}		rc = ipw_config(priv);		if (!rc) {			IPW_DEBUG_INFO("Configured device on count %i\n", i);			/* If configure to try and auto-associate, kick			 * off a scan. */			queue_work(priv->workqueue, &priv->request_scan);			return 0;		}		IPW_DEBUG_INFO("Device configuration failed: 0x%08X\n", rc);		IPW_DEBUG_INFO("Failed to config device on retry %d of %d\n",			       i, MAX_HW_RESTARTS);		/* We had an error bringing up the hardware, so take it		 * all the way back down so we can try again */		ipw_down(priv);	}	/* tried to restart and config the device for as long as our	 * patience could withstand */	IPW_ERROR("Unable to initialize device after %d attempts.\n", i);	return -EIO;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f6c5cb7c6f8a85045996bfc3442af963d6578d60/ipw2200.c/buggy/drivers/net/wireless/ipw2200.c