in clients/cmt_speech.c [318:350]
static int cs_hsi_alloc_data(struct cs_hsi_iface *hi)
{
struct hsi_msg *txmsg, *rxmsg;
int res = 0;
rxmsg = hsi_alloc_msg(1, GFP_KERNEL);
if (!rxmsg) {
res = -ENOMEM;
goto out1;
}
rxmsg->channel = cs_char_data.channel_id_data;
rxmsg->destructor = cs_hsi_data_destructor;
rxmsg->context = hi;
txmsg = hsi_alloc_msg(1, GFP_KERNEL);
if (!txmsg) {
res = -ENOMEM;
goto out2;
}
txmsg->channel = cs_char_data.channel_id_data;
txmsg->destructor = cs_hsi_data_destructor;
txmsg->context = hi;
hi->data_rx_msg = rxmsg;
hi->data_tx_msg = txmsg;
return 0;
out2:
hsi_free_msg(rxmsg);
out1:
return res;
}