diff options
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 54d0588fc1f6..f01096549a93 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -704,7 +704,8 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size) | |||
704 | char *new_name = (char *) param + param->data_start; | 704 | char *new_name = (char *) param + param->data_start; |
705 | 705 | ||
706 | if (new_name < param->data || | 706 | if (new_name < param->data || |
707 | invalid_str(new_name, (void *) param + param_size)) { | 707 | invalid_str(new_name, (void *) param + param_size) || |
708 | strlen(new_name) > DM_NAME_LEN - 1) { | ||
708 | DMWARN("Invalid new logical volume name supplied."); | 709 | DMWARN("Invalid new logical volume name supplied."); |
709 | return -EINVAL; | 710 | return -EINVAL; |
710 | } | 711 | } |
@@ -1063,7 +1064,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1063 | 1064 | ||
1064 | r = populate_table(t, param, param_size); | 1065 | r = populate_table(t, param, param_size); |
1065 | if (r) { | 1066 | if (r) { |
1066 | dm_table_put(t); | 1067 | dm_table_destroy(t); |
1067 | goto out; | 1068 | goto out; |
1068 | } | 1069 | } |
1069 | 1070 | ||
@@ -1071,7 +1072,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1071 | hc = dm_get_mdptr(md); | 1072 | hc = dm_get_mdptr(md); |
1072 | if (!hc || hc->md != md) { | 1073 | if (!hc || hc->md != md) { |
1073 | DMWARN("device has been removed from the dev hash table."); | 1074 | DMWARN("device has been removed from the dev hash table."); |
1074 | dm_table_put(t); | 1075 | dm_table_destroy(t); |
1075 | up_write(&_hash_lock); | 1076 | up_write(&_hash_lock); |
1076 | r = -ENXIO; | 1077 | r = -ENXIO; |
1077 | goto out; | 1078 | goto out; |