Browse Source

dm exception store: free tmp_store on persistent flag error

Error handling code following a kmalloc should free the allocated data.

Cc: stable@kernel.org
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Julia Lawall 15 years ago
parent
commit
613978f871
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/md/dm-exception-store.c

+ 2 - 1
drivers/md/dm-exception-store.c

@@ -216,7 +216,8 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
 		type = get_type("N");
 	else {
 		ti->error = "Persistent flag is not P or N";
-		return -EINVAL;
+		r = -EINVAL;
+		goto bad_type;
 	}
 
 	if (!type) {