Commit c2351249 authored by Dmitry Eremin's avatar Dmitry Eremin Committed by Greg Kroah-Hartman

staging: lustre: libcfs: avoid stomping on module param cpu_pattern

The function cfs_cpt_table_create_pattern() alters the string
passed to it. Currently we are passing in the module parameter
string cpu_pattern which is incorrect. Instead lets duplicate
the module parameter string and pass that to the function
cfs_cpt_table_create_pattern().
Signed-off-by: default avatarLiang Zhen <liang.zhen@intel.com>
Signed-off-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5050
Reviewed-on: http://review.whamcloud.com/22377Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aabb4ada
......@@ -1050,7 +1050,15 @@ cfs_cpu_init(void)
ret = -EINVAL;
if (*cpu_pattern) {
cfs_cpt_table = cfs_cpt_table_create_pattern(cpu_pattern);
char *cpu_pattern_dup = kstrdup(cpu_pattern, GFP_KERNEL);
if (!cpu_pattern_dup) {
CERROR("Failed to duplicate cpu_pattern\n");
goto failed;
}
cfs_cpt_table = cfs_cpt_table_create_pattern(cpu_pattern_dup);
kfree(cpu_pattern_dup);
if (!cfs_cpt_table) {
CERROR("Failed to create cptab from pattern %s\n",
cpu_pattern);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment