public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: net/mlx5: E-Switch, Add SR-IOV (FDB) support
Date: Thu, 10 Dec 2015 13:35:09 +0300	[thread overview]
Message-ID: <20151210103509.GA9143@mwanda> (raw)

Hello Saeed Mahameed,

The patch 81848731ff40: "net/mlx5: E-Switch, Add SR-IOV (FDB)
support" from Dec 1, 2015, leads to the following static checker
warning:

	drivers/net/ethernet/mellanox/mlx5/core/eswitch.c:579 esw_fdb_set_vport_rule()
	warn: passing zero to 'PTR_ERR'

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
   568          esw_debug(esw->dev,
   569                    "\tFDB add rule dmac_v(%pM) dmac_c(%pM) -> vport(%d)\n",
   570                    dmac_v, dmac_c, vport);
   571          flow_rule =
   572                  mlx5_add_flow_rule(esw,
   573                                     match_header,
   574                                     match_c,
   575                                     match_v,
   576                                     MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
   577                                     0, &dest);
   578          if (IS_ERR_OR_NULL(flow_rule)) {

mlx5_add_flow_rule() only returns NULL on error.  It never returns
ERR_PTRs.

   579                  pr_warn(
   580                          "FDB: Failed to add flow rule: dmac_v(%pM) dmac_c(%pM) -> vport(%d), err(%ld)\n",
                                                                                                     ^^^^^^^^
It's not a terrible bug but this always says "err(0)" which is not very
useful, and it causes this static checker warning.

   581                           dmac_v, dmac_c, vport, PTR_ERR(flow_rule));
   582                  flow_rule = NULL;
   583          }
   584  out:
   585          kfree(match_v);
   586          kfree(match_c);
   587          return flow_rule;
   588  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2015-12-10 10:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 10:35 Dan Carpenter [this message]
2015-12-10 14:45 ` net/mlx5: E-Switch, Add SR-IOV (FDB) support Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151210103509.GA9143@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox