re: net/mlx5: E-Switch, Add SR-IOV (FDB) support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux