Commit ced9a6ff authored by Federico Vaga's avatar Federico Vaga

helpers.c [fix]: __zio_arm_input_trigger: free blocks on raw_io error

Fix memory lost in an error condition
Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 568bc32a
......@@ -91,8 +91,17 @@ static int __zio_arm_input_trigger(struct zio_ti *ti)
chan->active_block = block;
}
i = cset->raw_io(cset);
if (!i)
if (!i) {
zio_trigger_data_done(cset); /* Succeeded */
} else if (i != -EAGAIN) {
/* Error: Free blocks */
dev_err(&ti->head.dev,
"raw_io failed (%i), cannot arm trigger\n", i);
chan_for_each(chan, cset) {
zbuf->b_op->free_block(chan->bi, chan->active_block);
}
}
return i;
}
......
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