sr: fx2lafw: Do not start a new acquisition if the old is still running
This may happen if the acquisition_start is called right after calling acquisition_stop and not all transfers have been freed or on repeated calls to acquisition_start. If it happens we'll enter an undefined state and all kind of strange behavior may occur, so error out in such a case. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
0caa1ef0cb
commit
c03f045004
|
@ -918,6 +918,10 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data)
|
||||||
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
|
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
ctx = sdi->priv;
|
ctx = sdi->priv;
|
||||||
|
|
||||||
|
if (ctx->submitted_transfers != 0)
|
||||||
|
return SR_ERR;
|
||||||
|
|
||||||
ctx->session_dev_id = cb_data;
|
ctx->session_dev_id = cb_data;
|
||||||
ctx->num_samples = 0;
|
ctx->num_samples = 0;
|
||||||
ctx->empty_transfer_count = 0;
|
ctx->empty_transfer_count = 0;
|
||||||
|
|
Loading…
Reference in New Issue