[<prev] [next>] [day] [month] [year] [list]
Message-ID: <94D0CD8314A33A4D9D801C0FE68B402958BA10D3@G9W0745.americas.hpqcorp.net>
Date: Mon, 14 Jul 2014 14:49:20 +0000
From: "Elliott, Robert (Server Storage)" <Elliott@...com>
To: "axboe@...nel.dk" <axboe@...nel.dk>,
"Elliott, Robert (Server Storage)" <Elliott@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] block: make blkdev_issue_flush check for NULL from bio_alloc
bio_alloc can return NULL if gfp_mask does not contain __GPF_WAIT
and it doesn't use a mempool. Since blkdev_issue_flush passes
along gfp_mask, it needs to check if bio_alloc returns NULL.
Signed-off-by: Robert Elliott <elliott@...com>
---
block/blk-flush.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 3cb5e9e..2a9fd20 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -457,6 +457,8 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
return -ENXIO;
bio = bio_alloc(gfp_mask, 0);
+ if (!bio)
+ return -ENOMEM;
bio->bi_bdev = bdev;
ret = submit_bio_wait(WRITE_FLUSH, bio);
---
Rob Elliott HP Server Storage
Powered by blists - more mailing lists