mirror of
https://github.com/schoebel/mars
synced 2025-01-04 21:33:01 +00:00
bio: fix invalid block allocations
This commit is contained in:
parent
324f472889
commit
4f936f0cd8
@ -294,6 +294,9 @@ static int bio_ref_get(struct bio_output *output, struct mref_object *mref)
|
||||
|
||||
|
||||
if (!mref->ref_data) { // buffered IO.
|
||||
if (unlikely(mref->ref_len <= 0)) {
|
||||
goto done;
|
||||
}
|
||||
status = -ENOMEM;
|
||||
mref->ref_data = brick_block_alloc(mref->ref_pos, (mref_a->alloc_len = mref->ref_len));
|
||||
if (unlikely(!mref->ref_data)) {
|
||||
|
Loading…
Reference in New Issue
Block a user