Commit 34fe9c27 authored by Nigel Cunningham's avatar Nigel Cunningham Committed by Linus Torvalds

[PATCH] Fix dm_io.c oops in low memory conditions.

If you call drivers/md/dm-io.c:resize_pool on an empty pool and
mempool_create is unable to make the pool, the condition is not handled
correctly, resulting in an oops in mempool_destroy.

Trivial fix.
parent c887c605
......@@ -267,7 +267,7 @@ static int resize_pool(unsigned int new_ios)
/* create new pool */
_io_pool = mempool_create(new_ios, alloc_io, free_io, NULL);
if (!_io_pool)
r = -ENOMEM;
return -ENOMEM;
r = bio_set_init(&_bios, "dm-io", 512, 1);
if (r) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment