* [PATCH -next] dm cache: fix error return code in cache_create()
@ 2013-04-19 5:11 Wei Yongjun
2013-04-25 20:30 ` Alasdair G Kergon
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-04-19 5:11 UTC (permalink / raw)
To: agk, neilb; +Cc: yongjun_wei, dm-devel, linux-raid
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fix to return -ENOMEM in the memory alloc error handing
cases instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/md/dm-cache-target.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index c5ce8a3b..c44f5e5 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1972,6 +1972,7 @@ static int cache_create(struct cache_args *ca, struct cache **result)
atomic_set(&cache->nr_migrations, 0);
init_waitqueue_head(&cache->migration_wait);
+ r = -ENOMEM;
cache->nr_dirty = 0;
cache->dirty_bitset = alloc_bitset(from_cblock(cache->cache_size));
if (!cache->dirty_bitset) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-25 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 5:11 [PATCH -next] dm cache: fix error return code in cache_create() Wei Yongjun
2013-04-25 20:30 ` Alasdair G Kergon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox