From 7798e78210369f2f81eb4d65cd1bb5e5f301efb8 Mon Sep 17 00:00:00 2001 From: Daeyeong Lee Date: Mon, 2 Jul 2018 13:31:07 +0900 Subject: [PATCH] sched: ems: Resolve prevent issue of ontime Change-Id: I6e1a00d806def40455d716d650cc813fc1b5b04d Signed-off-by: Daeyeong Lee --- kernel/sched/ems/ontime.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/sched/ems/ontime.c b/kernel/sched/ems/ontime.c index 0e21fb61083a..a773c9b824ac 100644 --- a/kernel/sched/ems/ontime.c +++ b/kernel/sched/ems/ontime.c @@ -51,7 +51,7 @@ struct ontime_cond { struct kobj_attribute down_threshold_attr; struct kobj_attribute min_residency_attr; }; -static struct ontime_cond *ontime_cond; +static struct ontime_cond *ontime_cond = NULL; /* Structure of ontime migration environment */ struct ontime_env { @@ -757,7 +757,7 @@ static int __init ontime_sysfs_init(void) step = 0; cond = ontime_cond; while (cond) { - char buf[20]; + char buf[25]; char *name; /* If ontime is disabled in this step, do not create sysfs node */ @@ -765,7 +765,7 @@ static int __init ontime_sysfs_init(void) goto skip; /* Init up_threshold node */ - sprintf(buf, "up_threshold_step%d", step); + snprintf(buf, sizeof(buf), "up_threshold_step%d", step); name = kstrdup(buf, GFP_KERNEL); if (!name) goto out; @@ -775,7 +775,7 @@ static int __init ontime_sysfs_init(void) ontime_attrs[i++] = &cond->up_threshold_attr.attr; /* Init down_threshold node */ - sprintf(buf, "down_threshold_step%d", step); + snprintf(buf, sizeof(buf), "down_threshold_step%d", step); name = kstrdup(buf, GFP_KERNEL); if (!name) goto out; @@ -785,7 +785,7 @@ static int __init ontime_sysfs_init(void) ontime_attrs[i++] = &cond->down_threshold_attr.attr; /* Init min_residency node */ - sprintf(buf, "min_residency_step%d", step); + snprintf(buf, sizeof(buf), "min_residency_step%d", step); name = kstrdup(buf, GFP_KERNEL); if (!name) goto out; -- 2.20.1