Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm snapshot: fix error return code in snapshot_ctr

Return -ENOMEM instead of success if unable to allocate pending
exception mempool in snapshot_ctr.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

authored by

Wei Yongjun and committed by
Alasdair G Kergon
09e8b813 fa4d683a

+1
+1
drivers/md/dm-snap.c
··· 1121 1121 s->pending_pool = mempool_create_slab_pool(MIN_IOS, pending_cache); 1122 1122 if (!s->pending_pool) { 1123 1123 ti->error = "Could not allocate mempool for pending exceptions"; 1124 + r = -ENOMEM; 1124 1125 goto bad_pending_pool; 1125 1126 } 1126 1127