lkml.org 
[lkml]   [2018]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax
Cheng, thanks for the patch!

On Fri, Nov 30, 2018 at 02:35:17PM +0800, Cheng Lin wrote:
> If the number of input parameters is less than the total
> parameters, an INVAL error will be returned.

Do you mean EINVAL?

> This patch ensure no error returned in this condition, just
> like other interfaces do.

Have an actual example to reproduce?

Luis

> Signed-off-by: Cheng Lin <cheng.lin130@zte.com.cn>
> ---
> kernel/sysctl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 5fc724e..9ee261f 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2779,6 +2779,8 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
> bool neg;
>
> left -= proc_skip_spaces(&p);
> + if (!left)
> + break;
>
> err = proc_get_long(&p, &left, &val, &neg,
> proc_wspace_sep,
> --
> 1.8.3.1
>

\
 
 \ /
  Last update: 2018-11-30 20:16    [W:0.068 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site