Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c694129 authored by Kumar Amit Mehta's avatar Kumar Amit Mehta Committed by Kent Overstreet
Browse files

md: bcache: io.c: fix a potential NULL pointer dereference



bio_alloc_bioset returns NULL on failure. This fix adds a missing check
for potential NULL pointer dereferencing.

Signed-off-by: default avatarKumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: default avatarKent Overstreet <koverstreet@google.com>
parent 9e895ace
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ struct bio *bch_bio_split(struct bio *bio, int sectors,

	if (bio->bi_rw & REQ_DISCARD) {
		ret = bio_alloc_bioset(gfp, 1, bs);
		if (!ret)
			return NULL;
		idx = 0;
		goto out;
	}