Skip to contentSkip to conversation

net/mlx5: Ethernet resource handling files

DISCUSSION Dan Carpenter 1 participant 1 message Jun 2, 2015 InfiniBand

lore
Share & tools
lore
#0 lore raw

Hello Amir Vadai,

The patch afb736e9330a: "net/mlx5: Ethernet resource handling files" from May 28, 2015, leads to the following static checker warning:

drivers/net/ethernet/mellanox/mlx5/core/en_flow_table.c:726 mlx5e_create_main_flow_table()
error: potential null dereference 'g'. (kcalloc returns null)

drivers/net/ethernet/mellanox/mlx5/core/en_flow_table.c
719 static int mlx5e_create_main_flow_table(struct mlx5e_priv *priv) 720 {
721 struct mlx5_flow_table_group *g;
722 u8 *dmac;
723
724 g = kcalloc(9, sizeof(*g), GFP_KERNEL);

It should check for allocation failure.

   725  
   726          g[0].log_sz = 2;
   727          g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
   728          MLX5_SET_TO_ONES(fte_match_param, g[0].match_criteria,
   729                           outer_headers.ethertype);
   730          MLX5_SET_TO_ONES(fte_match_param, g[0].match_criteria,
   731                           outer_headers.ip_protocol);
   732  

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