In bio_endio if bio doesn't have bi_end_io (should be an error case),
we set bio to NULL and continue silently without freeing the bio. It
would be good to have a WARN and free the bio to avoid memory leak.
Signed-off-by: Muthukumar Ratty <muthur@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
} else {
if (bio->bi_end_io)
bio->bi_end_io(bio, error);
+ else {
+ char dev_name[BDEVNAME_SIZE];
+
+ WARN(1, "bio_endio: bio for %s without endio\n",
+ bio->bi_bdev ? bdevname(bio->bi_bdev,
+ dev_name) : "(unknown)");
+ bio_put(bio);
+ }
+
bio = NULL;
}
}