/* free_bch - free the BCH control structure @bch: BCH control structure to release  */
void free_bch(struct bch_control *bch)
/* free_bch - free the BCH control structure @bch: BCH control structure to release  */
void free_bch(struct bch_control *bch)
{
	unsigned int i;
	if (bch) {
		kfree(bch->a_pow_tab);
		kfree(bch->a_log_tab);
		kfree(bch->mod8_tab);
		kfree(bch->ecc_buf);
		kfree(bch->ecc_buf2);
		kfree(bch->xi_tab);
		kfree(bch->syn);
		kfree(bch->cache);
		kfree(bch->elp);
		for (i = 0; i < ARRAY_SIZE(bch->poly_2t); i++)
			kfree(bch->poly_2t[i]);
		kfree(bch);
	}
}