projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d793e68
)
dm cache: fix error return code in cache_create
author
Wei Yongjun
<yongjun_wei@trendmicro.com.cn>
Fri, 10 May 2013 13:37:14 +0000
(14:37 +0100)
committer
Alasdair G Kergon
<agk@redhat.com>
Fri, 10 May 2013 13:37:14 +0000
(14:37 +0100)
Return -ENOMEM if memory allocation fails in cache_create
instead of 0 (to avoid NULL pointer dereference).
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-cache-target.c
patch
|
blob
|
history
diff --git
a/drivers/md/dm-cache-target.c
b/drivers/md/dm-cache-target.c
index
1074409
..
6feaba2
100644
(file)
--- a/
drivers/md/dm-cache-target.c
+++ b/
drivers/md/dm-cache-target.c
@@
-1971,6
+1971,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) {