if (awacs_tx_cmd_space) kfree(awacs_tx_cmd_space); 
kfree(awacs_tx_cmd_space); 
static int PMacWriteSqSetup(void){	int i, count = 600 ;	volatile struct dbdma_cmd *cp;	LOCK();		/* stop the controller from doing any output - if it isn't already.	   it _should_ be before this is called anyway */	out_le32(&awacs_txdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);	while ((in_le32(&awacs_txdma->status) & RUN) && count--)		udelay(1);#ifdef DEBUG_DMASOUNDif (count <= 0)	printk("dmasound_pmac: write sq setup: timeout waiting for dma to stop\n");#endif	if ((write_sq.max_count + 1) > number_of_tx_cmd_buffers) {		if (awacs_tx_cmd_space)			kfree(awacs_tx_cmd_space);		number_of_tx_cmd_buffers = 0;		/* we need nbufs + 1 (for the loop) and we should request + 1		   again because the DBDMA_ALIGN might pull the start up by up		   to sizeof(struct dbdma_cmd) - 4.		*/		awacs_tx_cmd_space = kmalloc			((write_sq.max_count + 1 + 1) * sizeof(struct dbdma_cmd),			 GFP_KERNEL);		if (awacs_tx_cmd_space == NULL) {			/* don't leave it dangling - nasty but better than a			   random address */			out_le32(&awacs_txdma->cmdptr, virt_to_bus(beep_dbdma_cmd));			printk(KERN_ERR			   "dmasound_pmac: can't allocate dbdma cmd buffers"			   ", driver disabled\n");			UNLOCK();			return -ENOMEM;		}		awacs_tx_cmds = (volatile struct dbdma_cmd *)			DBDMA_ALIGN(awacs_tx_cmd_space);		number_of_tx_cmd_buffers = write_sq.max_count + 1;	}	cp = awacs_tx_cmds;	memset((void *)cp, 0, (write_sq.max_count+1) * sizeof(struct dbdma_cmd));	for (i = 0; i < write_sq.max_count; ++i, ++cp) {		st_le32(&cp->phy_addr, virt_to_bus(write_sq.buffers[i]));	}	st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS);	st_le32(&cp->cmd_dep, virt_to_bus(awacs_tx_cmds));	/* point the controller at the command stack - ready to go */	out_le32(&awacs_txdma->cmdptr, virt_to_bus(awacs_tx_cmds));	UNLOCK();	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/09417379be9b126e10ae7dcd7afc20b666146266/dmasound_awacs.c/clean/sound/oss/dmasound/dmasound_awacs.c