mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 13:46:25 +00:00
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:
+1
-14
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user