lkml.org 
[lkml]   [2019]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] nfp: abm: fix memory leak in nfp_abm_u32_knode_replace
From
Date
> Updated other gotos to have correct errno returned, too.

How do you think about to add a jump target here?


> +++ b/drivers/net/ethernet/netronome/nfp/abm/cls.c
> @@ -176,8 +176,10 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
> u8 mask, val;
> int err;
>
> - if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack))
> + if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack)) {
> + err = -EOPNOTSUPP;
> goto err_delete;
> + }
>
> tos_off = proto == htons(ETH_P_IP) ? 16 : 20;

- goto err_delete;
+ goto e_opnotsupp;


> @@ -221,7 +227,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
>

+e_opnotsupp:
+ err = -EOPNOTSUPP;

> err_delete:
> nfp_abm_u32_knode_delete(alink, knode);
> - return -EOPNOTSUPP;
> + return err;
> }
>
> static int nfp_abm_setup_tc_block_cb(enum tc_setup_type type,


Can such a change variant be a bit nicer?

Regards,
Markus

\
 
 \ /
  Last update: 2019-09-27 14:13    [W:0.083 / U:1.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site