VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christoph Hellwig <hch@lst.de> 2021-02-24 08:24:07 +0100 committer: Jens Axboe <axboe@kernel.dk> 2021-02-24 08:55:00 -0700 commit: 47dc096ac183f465ffb03e86a203a38661695d72 parent: ebfe4183c77ed18e1d4237ad3b13f32114d9ae1e
Commit Summary:
block: memory allocations in bounce_clone_bio must not fail
Diffstat:
1 file changed, 2 insertions, 3 deletions
diff --git a/block/bounce.c b/block/bounce.c
index 417faaac36b6..87983a35079c 100644
--- a/block/bounce.c
+++ b/block/bounce.c
@@ -242,12 +242,11 @@ static struct bio *bounce_clone_bio(struct bio *bio_src)
 	 *    __bio_clone_fast() anyways.
 	 */
 	if (bio_is_passthrough(bio_src))
-		bio = bio_kmalloc(GFP_NOIO, bio_segments(bio_src));
+		bio = bio_kmalloc(GFP_NOIO | __GFP_NOFAIL,
+				  bio_segments(bio_src));
 	else
 		bio = bio_alloc_bioset(GFP_NOIO, bio_segments(bio_src),
 				       &bounce_bio_set);
-	if (!bio)
-		return NULL;
 	bio->bi_bdev		= bio_src->bi_bdev;
 	if (bio_flagged(bio_src, BIO_REMAPPED))
 		bio_set_flag(bio, BIO_REMAPPED);