|
@@ -1001,10 +1001,10 @@ static int uv_ptc_seq_show(struct seq_file *file, void *data)
|
|
static ssize_t tunables_read(struct file *file, char __user *userbuf,
|
|
static ssize_t tunables_read(struct file *file, char __user *userbuf,
|
|
size_t count, loff_t *ppos)
|
|
size_t count, loff_t *ppos)
|
|
{
|
|
{
|
|
- char buf[300];
|
|
|
|
|
|
+ char *buf;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- ret = snprintf(buf, 300, "%s %s %s\n%d %d %d %d %d %d %d %d %d\n",
|
|
|
|
|
|
+ buf = kasprintf(GFP_KERNEL, "%s %s %s\n%d %d %d %d %d %d %d %d %d\n",
|
|
"max_bau_concurrent plugged_delay plugsb4reset",
|
|
"max_bau_concurrent plugged_delay plugsb4reset",
|
|
"timeoutsb4reset ipi_reset_limit complete_threshold",
|
|
"timeoutsb4reset ipi_reset_limit complete_threshold",
|
|
"congested_response_us congested_reps congested_period",
|
|
"congested_response_us congested_reps congested_period",
|
|
@@ -1012,7 +1012,12 @@ static ssize_t tunables_read(struct file *file, char __user *userbuf,
|
|
timeoutsb4reset, ipi_reset_limit, complete_threshold,
|
|
timeoutsb4reset, ipi_reset_limit, complete_threshold,
|
|
congested_response_us, congested_reps, congested_period);
|
|
congested_response_us, congested_reps, congested_period);
|
|
|
|
|
|
- return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
|
|
|
|
|
|
+ if (!buf)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
|
|
+ ret = simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf));
|
|
|
|
+ kfree(buf);
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|