Re: [PATCH] misc: mic: use kstrdup() in cosm_sysfs

2015-10-10 Thread Ashutosh Dixit
On Sat, Oct 10 2015 at 12:14:30 PM, Joe Perches wrote: > On Sat, 2015-10-10 at 04:46 -0700, Geliang Tang wrote: >> Use kstrdup instead of kmalloc and strncpy. > >> diff --git a/drivers/misc/mic/cosm/cosm_sysfs.c >> b/drivers/misc/mic/cosm/cosm_sysfs.c > [] >> @@ -211,18 +211,14 @@ cmdline_store(s

Re: [PATCH] misc: mic: use kstrdup() in cosm_sysfs

2015-10-10 Thread Joe Perches
On Sat, 2015-10-10 at 04:46 -0700, Geliang Tang wrote: > Use kstrdup instead of kmalloc and strncpy. As count is a function argument, this isn't the same code. You should state why it's correct in the commit log. > diff --git a/drivers/misc/mic/cosm/cosm_sysfs.c > b/drivers/misc/mic/cosm/cosm_s

[PATCH] misc: mic: use kstrdup() in cosm_sysfs

2015-10-10 Thread Geliang Tang
Use kstrdup instead of kmalloc and strncpy. Signed-off-by: Geliang Tang --- drivers/misc/mic/cosm/cosm_sysfs.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/misc/mic/cosm/cosm_sysfs.c b/drivers/misc/mic/cosm/cosm_sysfs.c index 29d6863..c3db