diff options
| author | Heinz Mauelshagen <heinzm@redhat.com> | 2013-03-07 11:54:12 +1100 |
|---|---|---|
| committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-03-07 11:54:12 +1100 |
| commit | f1ccbd181202c660b237b9bef0af277b980d5073 (patch) | |
| tree | e480c842feb16d3f158934d5b1a2a1b60c46764f | |
| parent | c3c7dc35d9695b09fa258f967add30b7dcb98ade (diff) | |
| download | linux-next-f1ccbd181202c660b237b9bef0af277b980d5073.tar.gz | |
Return error if cache_create() fails.
Notice: this object is not reachable from any branch.
A missing return check made cache_ctr continue even after an error in
cache_create() resulting in the cache object being destroyed. So a
simple failure like an odd number of cache policy config value arguments
would result in an oops.
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Notice: this object is not reachable from any branch.
| -rw-r--r-- | drivers/md/dm-cache-target.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 5ad227f0cea3f..76cc910557f04 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2009,6 +2009,8 @@ static int cache_ctr(struct dm_target *ti, unsigned argc, char **argv) goto out; r = cache_create(ca, &cache); + if (r) + goto out; r = copy_ctr_args(cache, argc - 3, (const char **)argv + 3); if (r) { |
