diff options
-rw-r--r-- | drivers/md/dm-verity-fec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index c3cc04d89524..78f36012eaca 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c | |||
@@ -146,8 +146,6 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio, | |||
146 | block = fec_buffer_rs_block(v, fio, n, i); | 146 | block = fec_buffer_rs_block(v, fio, n, i); |
147 | res = fec_decode_rs8(v, fio, block, &par[offset], neras); | 147 | res = fec_decode_rs8(v, fio, block, &par[offset], neras); |
148 | if (res < 0) { | 148 | if (res < 0) { |
149 | dm_bufio_release(buf); | ||
150 | |||
151 | r = res; | 149 | r = res; |
152 | goto error; | 150 | goto error; |
153 | } | 151 | } |
@@ -172,6 +170,8 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio, | |||
172 | done: | 170 | done: |
173 | r = corrected; | 171 | r = corrected; |
174 | error: | 172 | error: |
173 | dm_bufio_release(buf); | ||
174 | |||
175 | if (r < 0 && neras) | 175 | if (r < 0 && neras) |
176 | DMERR_LIMIT("%s: FEC %llu: failed to correct: %d", | 176 | DMERR_LIMIT("%s: FEC %llu: failed to correct: %d", |
177 | v->data_dev->name, (unsigned long long)rsb, r); | 177 | v->data_dev->name, (unsigned long long)rsb, r); |
@@ -269,7 +269,7 @@ static int fec_read_bufs(struct dm_verity *v, struct dm_verity_io *io, | |||
269 | &is_zero) == 0) { | 269 | &is_zero) == 0) { |
270 | /* skip known zero blocks entirely */ | 270 | /* skip known zero blocks entirely */ |
271 | if (is_zero) | 271 | if (is_zero) |
272 | continue; | 272 | goto done; |
273 | 273 | ||
274 | /* | 274 | /* |
275 | * skip if we have already found the theoretical | 275 | * skip if we have already found the theoretical |