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 {
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 */
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;
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;
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;