From: Daeyeong Lee Date: Mon, 2 Jul 2018 04:31:07 +0000 (+0900) Subject: sched: ems: Resolve prevent issue of ontime X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7798e78210369f2f81eb4d65cd1bb5e5f301efb8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sched: ems: Resolve prevent issue of ontime Change-Id: I6e1a00d806def40455d716d650cc813fc1b5b04d Signed-off-by: Daeyeong Lee --- 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;