[PATCH] kernel/sysctl.c: check return value after call proc_put_char() in __do_proc_doulongvec_minmax()
Need check the return value of proc_put_char(), just like another have done in __do_proc_doulongvec_minmax(). Signed-off-by: Chen Gang --- kernel/sysctl.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b2f06f3..7453418 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2214,8 +2214,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int *i = val; } else { val = convdiv * (*i) / convmul; - if (!first) + if (!first) { err = proc_put_char(, , '\t'); + if (err) + break; + } err = proc_put_long(, , val, false); if (err) break; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] kernel/sysctl.c: check return value after call proc_put_char() in __do_proc_doulongvec_minmax()
Need check the return value of proc_put_char(), just like another have done in __do_proc_doulongvec_minmax(). Signed-off-by: Chen Gang gang.c...@asianux.com --- kernel/sysctl.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b2f06f3..7453418 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2214,8 +2214,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int *i = val; } else { val = convdiv * (*i) / convmul; - if (!first) + if (!first) { err = proc_put_char(buffer, left, '\t'); + if (err) + break; + } err = proc_put_long(buffer, left, val, false); if (err) break; -- 1.7.7.6 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/