Commit ca6cf8bf authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dm: Log an error if the target has unknown target type, or zero length.

From: Kevin Corry <kevcorry@us.ibm.com>

Log an error if the target has unknown target type, or zero length.
parent fa899763
......@@ -663,12 +663,14 @@ int dm_table_add_target(struct dm_table *t, const char *type,
if (!len) {
tgt->error = "zero-length target";
DMERR(": %s\n", tgt->error);
return -EINVAL;
}
tgt->type = dm_get_target_type(type);
if (!tgt->type) {
tgt->error = "unknown target type";
DMERR(": %s\n", tgt->error);
return -EINVAL;
}
......@@ -705,7 +707,7 @@ int dm_table_add_target(struct dm_table *t, const char *type,
return 0;
bad:
printk(KERN_ERR DM_NAME ": %s\n", tgt->error);
DMERR(": %s\n", tgt->error);
dm_put_target_type(tgt->type);
return r;
}
......
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