if (state) kfree(state); 
kfree(state); 
struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,				   struct i2c_adapter* i2c){	struct nxt200x_state* state = NULL;	u8 buf [] = {0,0,0,0,0};	/* allocate memory for the internal state */	state = (struct nxt200x_state*) kmalloc(sizeof(struct nxt200x_state), GFP_KERNEL);	if (state == NULL)		goto error;	memset(state,0,sizeof(*state));	/* setup the state */	state->config = config;	state->i2c = i2c;	memcpy(&state->ops, &nxt200x_ops, sizeof(struct dvb_frontend_ops));	state->initialised = 0;	/* read card id */	nxt200x_readbytes(state, 0x00, buf, 5);	dprintk("NXT info: %02X %02X %02X %02X %02X\n",		buf[0], buf[1], buf[2],	buf[3], buf[4]);	/* set demod chip */	switch (buf[0]) {		case 0x04:			state->demod_chip = NXT2002;			printk("nxt200x: NXT2002 Detected\n");			break;		case 0x05:			state->demod_chip = NXT2004;			printk("nxt200x: NXT2004 Detected\n");			break;		default:			goto error;	}	/* make sure demod chip is supported */	switch (state->demod_chip) {		case NXT2002:			if (buf[0] != 0x04) goto error;		/* device id */			if (buf[1] != 0x02) goto error;		/* fab id */			if (buf[2] != 0x11) goto error;		/* month */			if (buf[3] != 0x20) goto error;		/* year msb */			if (buf[4] != 0x00) goto error;		/* year lsb */			break;		case NXT2004:			if (buf[0] != 0x05) goto error;		/* device id */			break;		default:			goto error;	}	/* create dvb_frontend */	state->frontend.ops = &state->ops;	state->frontend.demodulator_priv = state;	return &state->frontend;error:	if (state)		kfree(state);	printk("Unknown/Unsupported NXT chip: %02X %02X %02X %02X %02X\n",		buf[0], buf[1], buf[2], buf[3], buf[4]);	return NULL;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/6d35ae3d1137c92a315b7ff10aecd45b1f37d99e/nxt200x.c/buggy/drivers/media/dvb/frontends/nxt200x.c