scst/sysfs: Eliminated a superfluous string copy operation in the acess control group creation code.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2827 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2010-11-25 09:32:34 +00:00
parent d30313e587
commit 714461dd04
+1 -14
View File
@@ -3581,8 +3581,6 @@ static int scst_process_ini_group_mgmt_store(char *buffer,
struct scst_tgt *tgt)
{
int res, action;
int len;
char *name;
char *p, *e = NULL;
struct scst_acg *a, *acg = NULL;
@@ -3651,18 +3649,7 @@ static int scst_process_ini_group_mgmt_store(char *buffer,
res = -EINVAL;
goto out_unlock;
}
len = strlen(p) + 1;
name = kmalloc(len, GFP_KERNEL);
if (name == NULL) {
PRINT_ERROR("%s", "Allocation of name failed");
res = -ENOMEM;
goto out_unlock;
}
strlcpy(name, p, len);
acg = scst_alloc_add_acg(tgt, name, true);
kfree(name);
acg = scst_alloc_add_acg(tgt, p, true);
if (acg == NULL)
goto out_unlock;
break;