]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bnxt: Avoid logging an unnecessary message when a flow can't be offloaded
authorSomnath Kotur <somnath.kotur@broadcom.com>
Thu, 31 Oct 2019 05:07:46 +0000 (01:07 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Oct 2019 21:48:11 +0000 (14:48 -0700)
For every single case where bnxt_tc_can_offload() can fail, we are
logging a user friendly descriptive message anyway, but because of the
path it would take in case of failure, another redundant error message
would get logged. Just freeing the node and returning from the point of
failure should suffice.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

index 80b39ffa4ca221c1c7184b351ae0642a17caabd9..c35cde8a5b29bed90a0778696586236a22e70c1b 100644 (file)
@@ -1406,7 +1406,8 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid,
 
        if (!bnxt_tc_can_offload(bp, flow)) {
                rc = -EOPNOTSUPP;
-               goto free_node;
+               kfree_rcu(new_node, rcu);
+               return rc;
        }
 
        /* If a flow exists with the same cookie, delete it */