diff options
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_parameters.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_parameters.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index 7a461fbb1566..6bc3aaf655fc 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c @@ -1357,14 +1357,12 @@ int iscsi_decode_text_input( struct iscsi_param_list *param_list = conn->param_list; char *tmpbuf, *start = NULL, *end = NULL; - tmpbuf = kzalloc(length + 1, GFP_KERNEL); + tmpbuf = kmemdup_nul(textbuf, length, GFP_KERNEL); if (!tmpbuf) { pr_err("Unable to allocate %u + 1 bytes for tmpbuf.\n", length); return -ENOMEM; } - memcpy(tmpbuf, textbuf, length); - tmpbuf[length] = '\0'; start = tmpbuf; end = (start + length); |