public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: net/mlx5: Ethernet resource handling files
Date: Tue, 2 Jun 2015 13:02:14 +0300	[thread overview]
Message-ID: <20150602100214.GA11247@mwanda> (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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2015-06-02 10:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20150602100214.GA11247@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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