All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Bart Van Assche
	<bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH V1] IB/core: Do not allocate more memory than required for cma_configfs
Date: Tue, 19 Jan 2016 16:14:24 -0500	[thread overview]
Message-ID: <569EA730.2020205@redhat.com> (raw)
In-Reply-To: <1451551743-26042-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

On 12/31/2015 03:49 AM, Matan Barak wrote:
> We were allocating larger memory space than required for
> cma_dev_group->default_ports_group.
> 
> Fixes: 045959db65c6 ('IB/cma: Add configfs for rdma_cm')
> Signed-off-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> Hi Doug,
> 
> This patch fixes a small issue, where we allocated more space than we
> actually needed. This was introduces in the RoCE v2 series.
> 
> Regards,
> Matan
> 
> Changes from V0:
>  - Change subject and fix spelling mistake in commit message
> 
>  drivers/infiniband/core/cma_configfs.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c
> index bd1d640..ab554df 100644
> --- a/drivers/infiniband/core/cma_configfs.c
> +++ b/drivers/infiniband/core/cma_configfs.c
> @@ -169,9 +169,10 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group,
>  	ports = kcalloc(ports_num, sizeof(*cma_dev_group->ports),
>  			GFP_KERNEL);
>  
> -	cma_dev_group->default_ports_group = kcalloc(ports_num + 1,
> -						     sizeof(*cma_dev_group->ports),
> -						     GFP_KERNEL);
> +	cma_dev_group->default_ports_group =
> +		kcalloc(ports_num + 1,
> +			sizeof(*cma_dev_group->default_ports_group),
> +			GFP_KERNEL);
>  
>  	if (!ports || !cma_dev_group->default_ports_group) {
>  		err = -ENOMEM;
> 

Hi Matan, as I'm sure you saw, I grabbed Dan's patch for this.  I didn't
choose either one over the other, I just ran across his in patchworks
first as I was looking for all of the code I needed to review.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  parent reply	other threads:[~2016-01-19 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-31  8:49 [PATCH V1] IB/core: Do not allocate more memory than required for cma_configfs Matan Barak
     [not found] ` <1451551743-26042-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-01-19 21:14   ` Doug Ledford [this message]
     [not found]     ` <569EA730.2020205-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-20  8:20       ` Matan Barak (External)

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=569EA730.2020205@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ogerlitz-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.