From 714461dd041b62150e9ad35b48d4b045d9f4c90e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 25 Nov 2010 09:32:34 +0000 Subject: [PATCH] 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 --- scst/src/scst_sysfs.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index bf3315286..e1d1541fa 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -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;