diff mbox series

[iproute2,1/2] dcb: fix return value on dcb_cmd_app_show

Message ID d2475b23f31e8cb1eb19d51d8bb10866a06a418c.1619886883.git.aclaudi@redhat.com (mailing list archive)
State Accepted
Delegated to: David Ahern
Headers show
Series dcb: some misc fixes | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Andrea Claudi May 1, 2021, 4:39 p.m. UTC
dcb_cmd_app_show() is supposed to return EINVAL if an incorrect argument
is provided.

Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 dcb/dcb_app.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Machata May 5, 2021, 8:39 a.m. UTC | #1
Andrea Claudi <aclaudi@redhat.com> writes:

> dcb_cmd_app_show() is supposed to return EINVAL if an incorrect argument
> is provided.
>
> Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> ---
>  dcb/dcb_app.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
> index c4816bc2..28f40614 100644
> --- a/dcb/dcb_app.c
> +++ b/dcb/dcb_app.c
> @@ -667,7 +667,7 @@ static int dcb_cmd_app_show(struct dcb *dcb, const char *dev, int argc, char **a
>  out:
>  	close_json_object();
>  	dcb_app_table_fini(&tab);
> -	return 0;
> +	return ret;
>  }
>  
>  static int dcb_cmd_app_flush(struct dcb *dcb, const char *dev, int argc, char **argv)

Nice catch. Looks good,

Reviewed-by: Petr Machata <me@pmachata.org>
David Ahern May 6, 2021, 2:48 p.m. UTC | #2
On 5/1/21 10:39 AM, Andrea Claudi wrote:
> dcb_cmd_app_show() is supposed to return EINVAL if an incorrect argument
> is provided.
> 
> Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> ---
>  dcb/dcb_app.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

applied both
diff mbox series

Patch

diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
index c4816bc2..28f40614 100644
--- a/dcb/dcb_app.c
+++ b/dcb/dcb_app.c
@@ -667,7 +667,7 @@  static int dcb_cmd_app_show(struct dcb *dcb, const char *dev, int argc, char **a
 out:
 	close_json_object();
 	dcb_app_table_fini(&tab);
-	return 0;
+	return ret;
 }
 
 static int dcb_cmd_app_flush(struct dcb *dcb, const char *dev, int argc, char **argv)