From: Heinz Mauelshagen <[email-masked]>

Return error if cache_create() fails.

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 <[email-masked]>
Signed-off-by: Mike Snitzer <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>

---
 drivers/md/dm-cache-target.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux/drivers/md/dm-cache-target.c
===================================================================
--- linux.orig/drivers/md/dm-cache-target.c
+++ linux/drivers/md/dm-cache-target.c
@@ -2009,6 +2009,8 @@ static int cache_ctr(struct dm_target *t
 		goto out;
 
 	r = cache_create(ca, &cache);
+	if (r)
+		goto out;
 
 	r = copy_ctr_args(cache, argc - 3, (const char **)argv + 3);
 	if (r) {