summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/bio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bio.c b/fs/bio.c
index cf747378b97..d4f06327c81 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -465,8 +465,10 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);
- if (ret < 0)
+ if (ret < 0) {
+ bio_put(b);
return NULL;
+ }
}
return b;