diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-05-10 09:37:15 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2013-05-10 09:37:15 -0400 |
commit | 09e8b813897a0f85bb401435d009228644c81214 (patch) | |
tree | 4ce61c46f1db01c6f15b34e15657606bacacd63c /drivers/md/dm-snap.c | |
parent | fa4d683af3693863bec761e2761a07e4c1351f86 (diff) |
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>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index c0e07026a8d1..c434e5aab2df 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -1121,6 +1121,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1121 | s->pending_pool = mempool_create_slab_pool(MIN_IOS, pending_cache); | 1121 | s->pending_pool = mempool_create_slab_pool(MIN_IOS, pending_cache); |
1122 | if (!s->pending_pool) { | 1122 | if (!s->pending_pool) { |
1123 | ti->error = "Could not allocate mempool for pending exceptions"; | 1123 | ti->error = "Could not allocate mempool for pending exceptions"; |
1124 | r = -ENOMEM; | ||
1124 | goto bad_pending_pool; | 1125 | goto bad_pending_pool; |
1125 | } | 1126 | } |
1126 | 1127 | ||