mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 01:24:33 +00:00
dm cache: detect cache_create failure
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 <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
parent
414dd67d50
commit
617a0b89da
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user