netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sathya.perla@broadcom.com
Cc: netdev@vger.kernel.org
Subject: Re: [net-next PATCH 4/4] be2net: replace polling with sleeping in the FW completion path
Date: Mon, 25 Jul 2016 10:51:30 -0700 (PDT)	[thread overview]
Message-ID: <20160725.105130.1337790235000032163.davem@davemloft.net> (raw)
In-Reply-To: <1469184946-26309-5-git-send-email-sathya.perla@broadcom.com>

From: Sathya Perla <sathya.perla@broadcom.com>
Date: Fri, 22 Jul 2016 06:55:46 -0400

> @@ -4477,6 +4551,22 @@ static int be_if_create(struct be_adapter *adapter)
>  	u32 cap_flags = be_if_cap_flags(adapter);
>  	int status;
>  
> +	/* alloc required memory for other filtering fields */
> +	adapter->pmac_id = kcalloc(be_max_uc(adapter),
> +				   sizeof(*adapter->pmac_id), GFP_KERNEL);
> +	if (!adapter->pmac_id)
> +		return -ENOMEM;
> +
> +	adapter->mc_list = kcalloc(be_max_mc(adapter),
> +				   sizeof(*adapter->mc_list), GFP_KERNEL);
> +	if (!adapter->mc_list)
> +		return -ENOMEM;
> +
> +	adapter->uc_list = kcalloc(be_max_uc(adapter),
> +				   sizeof(*adapter->uc_list), GFP_KERNEL);
> +	if (!adapter->uc_list)
> +		return -ENOMEM;

These error paths are leaking memory, please audit this in the rest of your
change as well.

  reply	other threads:[~2016-07-25 17:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 10:55 [net-next PATCH 0/4] be2net: patch set Sathya Perla
2016-07-22 10:55 ` [net-next PATCH 1/4] be2net: clear vlan-promisc setting before programming the vlan list Sathya Perla
2016-07-22 10:55 ` [net-next PATCH 2/4] be2net: do not remove vids from driver table if be_vid_config() fails Sathya Perla
2016-07-22 10:55 ` [net-next PATCH 3/4] be2net: Avoid unnecessary firmware updates of multicast list Sathya Perla
2016-07-22 10:55 ` [net-next PATCH 4/4] be2net: replace polling with sleeping in the FW completion path Sathya Perla
2016-07-25 17:51   ` David Miller [this message]
2016-07-26  7:18     ` Sathya Perla
2016-07-26  8:10       ` Sathya Perla
2016-07-27  8:03         ` Sathya Perla
2016-07-27  8:07           ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-07-27  9:26 [net-next PATCH 0/4] be2net: patch set Sathya Perla
2016-07-27  9:26 ` [net-next PATCH 4/4] be2net: replace polling with sleeping in the FW completion path Sathya Perla

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=20160725.105130.1337790235000032163.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sathya.perla@broadcom.com \
    /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;
as well as URLs for NNTP newsgroup(s).