Skip to contentSkip to conversation

PATCH (Trivial): Fix dm_io.c oops in low memory conditions.

PATCH Nigel Cunningham 1 participant 1 message Nov 9, 2004 Device mapper

lore
Share & tools
lore
#0 lore raw

Hi.

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.

Please apply.

Regards,

Nigel

drivers/md/dm-io.c +1 -1
diff -ruN 900-dm-low-memory-fix-old/drivers/md/dm-io.c 900-dm-low-memory-fix-new/drivers/md/dm-io.c
@@ -265,7 +265,7 @@
 		/* 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) {
Signature · 7 lines
Nigel Cunningham
Pastoral Worker
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901

You see, at just the right time, when we were still powerless, Christ
died for the ungodly.		-- Romans 5:6