Skip to content
Snippets Groups Projects
Commit 0845d6ca authored by Federico Vaga's avatar Federico Vaga Committed by Alessandro Rubini
Browse files

zio_fire_trigger: fixed memory leakage and error message


We didn't free the input blocks if dev->input_block() or
buf->store_block() fails.

Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent e10ff651
No related merge requests found
...@@ -139,13 +139,19 @@ int zio_fire_trigger(struct zio_ti *ti) ...@@ -139,13 +139,19 @@ int zio_fire_trigger(struct zio_ti *ti)
/* get samples, and control block */ /* get samples, and control block */
err = zdev->d_op->input_block(chan, block); err = zdev->d_op->input_block(chan, block);
if (err) { if (err) {
pr_err("%s: no input block for %s:%i:%i\n", __func__, pr_err("%s: input_block(%s:%i:%i) error %d\n", __func__,
chan->cset->zdev->head.name, chan->cset->zdev->head.name,
chan->cset->index, chan->cset->index,
chan->index); chan->index,
/* TODO what to do? destroy everything? continue? */ err);
zbuf->b_op->free_block(chan->bi, block);
} }
zbuf->b_op->store_block(chan->bi, block); err = zbuf->b_op->store_block(chan->bi, block);
if (err) {
/* no error message for common error */
zbuf->b_op->free_block(chan->bi, block);
}
} }
return 0; return 0;
out_alloc: out_alloc:
......
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