public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: mlx5: Add driver for Mellanox Connect-IB adapters
Date: Mon, 15 Jul 2013 18:18:43 +0300	[thread overview]
Message-ID: <20130715151843.GD21894@mtldesk30> (raw)
In-Reply-To: <20130710105538.GB31232-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>

Hi Dan,
thanks for cathing this. I will fix this an a subsequent patch.
Currently we can consider this non critical as we don't use commands
from interrupt context.

On Wed, Jul 10, 2013 at 01:55:38PM +0300, Dan Carpenter wrote:
> Hello Eli Cohen,
> 
> The patch e126ba97dba9: "mlx5: Add driver for Mellanox Connect-IB
> adapters" from Jul 7, 2013, leads to the following Smatch warning:
> "drivers/net/ethernet/mellanox/mlx5/core/cmd.c:822
> mlx5_alloc_cmd_msg()
> 	 warn: use 'flags' here instead of GFP_XXX?"
> 
>    811  static struct mlx5_cmd_msg *mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev,
>    812                                                 gfp_t flags, int size)
>                                                        ^^^^^^^^^^^
> 
>    813  {
>    814          struct mlx5_cmd_mailbox *tmp, *head = NULL;
>    815          struct mlx5_cmd_prot_block *block;
>    816          struct mlx5_cmd_msg *msg;
>    817          int blen;
>    818          int err;
>    819          int n;
>    820          int i;
>    821  
>    822          msg = kzalloc(sizeof(*msg), GFP_KERNEL);
>                                             ^^^^^^^^^^
>    823          if (!msg)
>    824                  return ERR_PTR(-ENOMEM);
>    825  
>    826          blen = size - min_t(int, sizeof(msg->first.data), size);
>    827          n = (blen + MLX5_CMD_DATA_BLOCK_SIZE - 1) / MLX5_CMD_DATA_BLOCK_SIZE;
>    828  
>    829          for (i = 0; i < n; i++) {
>    830                  tmp = alloc_cmd_box(dev, flags);
>                                                  ^^^^^
> There is a kmalloc() in alloc_cmd_box() that uses flags as well as a
> pci_pool_alloc() that uses it.
> 
>    831                  if (IS_ERR(tmp)) {
>    832                          mlx5_core_warn(dev, "failed allocating block\n");
> 
> 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
--
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

  parent reply	other threads:[~2013-07-15 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 10:55 mlx5: Add driver for Mellanox Connect-IB adapters Dan Carpenter
     [not found] ` <20130710105538.GB31232-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>
2013-07-15 14:29   ` Or Gerlitz
2013-07-15 15:18   ` Eli Cohen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-06-20 17:58 Dan Carpenter
2014-06-26 10:37 ` Eli Cohen
2013-07-10 10:54 Dan Carpenter
     [not found] ` <20130710105415.GA31232-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>
2013-07-10 11:28   ` Or Gerlitz
2013-07-10 20:16   ` Josh Triplett

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=20130715151843.GD21894@mtldesk30 \
    --to=eli-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=eli-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