[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240219095138.3e576a50@hermes.local>
Date: Mon, 19 Feb 2024 09:51:38 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Maks Mishin <maks.mishinfz@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] ctrl: Add check for result rtnl_dump_filter()
On Sun, 18 Feb 2024 22:43:09 +0300
Maks Mishin <maks.mishinfz@...il.com> wrote:
> Added check for result of rtnl_dump_filter() function
> for catch errors linked with dump.
> Found by RASU JSC.
>
> Signed-off-by: Maks Mishin <maks.mishinFZ@...il.com>
> ---
> genl/ctrl.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/genl/ctrl.c b/genl/ctrl.c
> index aff922a4..467a2830 100644
> --- a/genl/ctrl.c
> +++ b/genl/ctrl.c
> @@ -313,7 +313,10 @@ static int ctrl_list(int cmd, int argc, char **argv)
> goto ctrl_done;
> }
>
> - rtnl_dump_filter(&rth, print_ctrl2, stdout);
> + if (rtnl_dump_filter(&rth, print_ctrl2, stdout) < 0) {
> + fprintf(stderr, "Dump terminated\n");
> + exit(1);
Why does this have to be fatal and call exit()?
Other places in same code just return error.
Powered by blists - more mailing lists