Commit b6b5a445 authored by Lucas Russo's avatar Lucas Russo

hal/*/modules/acq/*_exp.c: fix missing channel number check

This is a trivial bug, in which we weren't checking for the
validity of the requested channel number.
parent 34e7f573
......@@ -193,7 +193,15 @@ static int _acq_get_data_block (void *owner, void *args, void *ret)
uint32_t chan = *(uint32_t *) EXP_MSG_ZMQ_FIRST_ARG(args);
uint32_t block_n = *(uint32_t *) EXP_MSG_ZMQ_NEXT_ARG(args);
DBE_DEBUG (DBG_SM_IO | DBG_LVL_TRACE, "[sm_io:acq] get_data_block: "
"chan = %u, block_n = %u\n",chan, block_n);
"chan = %u, block_n = %u\n", chan, block_n);
/* channel required is out of the limit */
if (chan > SMIO_ACQ_NUM_CHANNELS-1) {
DBE_DEBUG (DBG_SM_IO | DBG_LVL_WARN, "[sm_io:acq] data_acquire: "
"Channel required is out of the maximum limit\n");
return -ACQ_NUM_CHAN_OOR;
}
/* Channel features */
DBE_DEBUG (DBG_SM_IO | DBG_LVL_TRACE, "[sm_io:acq] get_data_block: "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment