Commit 7e2ec88a authored by Joe Thornber's avatar Joe Thornber Committed by Linus Torvalds

[PATCH] dm: return correct error codes from dm_table_add_target()

Return correct error codes from dm_table_add_target().  [Kevin Corry]
parent 8a87a873
...@@ -591,7 +591,7 @@ int dm_table_add_target(struct dm_table *t, const char *type, ...@@ -591,7 +591,7 @@ int dm_table_add_target(struct dm_table *t, const char *type,
tgt->type = dm_get_target_type(type); tgt->type = dm_get_target_type(type);
if (!tgt->type) { if (!tgt->type) {
tgt->error = "unknown target type"; tgt->error = "unknown target type";
return r; return -EINVAL;
} }
tgt->table = t; tgt->table = t;
...@@ -604,6 +604,7 @@ int dm_table_add_target(struct dm_table *t, const char *type, ...@@ -604,6 +604,7 @@ int dm_table_add_target(struct dm_table *t, const char *type,
*/ */
if (!adjoin(t, tgt)) { if (!adjoin(t, tgt)) {
tgt->error = "Gap in table"; tgt->error = "Gap in table";
r = -EINVAL;
goto bad; goto bad;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment