projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
block: don't access bio->bi_error after bio_put()
[cascardo/linux.git]
/
drivers
/
md
/
dm-io.c
diff --git
a/drivers/md/dm-io.c
b/drivers/md/dm-io.c
index
74adcd2
..
c84714f
100644
(file)
--- a/
drivers/md/dm-io.c
+++ b/
drivers/md/dm-io.c
@@
-134,12
+134,13
@@
static void dec_count(struct io *io, unsigned int region, int error)
complete_io(io);
}
complete_io(io);
}
-static void endio(struct bio *bio
, int error
)
+static void endio(struct bio *bio)
{
struct io *io;
unsigned region;
{
struct io *io;
unsigned region;
+ int error;
- if (error && bio_data_dir(bio) == READ)
+ if (
bio->bi_
error && bio_data_dir(bio) == READ)
zero_fill_bio(bio);
/*
zero_fill_bio(bio);
/*
@@
-147,6
+148,7
@@
static void endio(struct bio *bio, int error)
*/
retrieve_io_and_region_from_bio(bio, &io, ®ion);
*/
retrieve_io_and_region_from_bio(bio, &io, ®ion);
+ error = bio->bi_error;
bio_put(bio);
dec_count(io, region, error);
bio_put(bio);
dec_count(io, region, error);