linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>,
	takafumi.kubota1012@sslab.ics.keio.ac.jp,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"open list:NETRONOME ETHERNET DRIVERS"
	<oss-drivers@netronome.com>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
	keitasuzuki.park@sslab.ics.keio.ac.jp,
	takafumi.kubota1012@sslab.ics.keio.ac.jp,
	Jakub Kicinski <kuba@kernel.org>,
	"open list:NETRONOME ETHERNET DRIVERS"
	<oss-drivers@netronome.com>
Subject: Re: [PATCH] nfp: Fix memory leak in nfp_resource_acquire()
Date: Mon, 20 Apr 2020 15:49:34 +0800	[thread overview]
Message-ID: <202004201549.0EZ6dyQ7%lkp@intel.com> (raw)
In-Reply-To: <20200409150210.15488-1-keitasuzuki.park@sslab.ics.keio.ac.jp>

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

Hi Keita,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.7-rc1 next-20200416]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Keita-Suzuki/nfp-Fix-memory-leak-in-nfp_resource_acquire/20200410-032846
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5d30bcacd91af6874481129797af364a53cd9b46
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c: In function 'nfp_resource_acquire':
>> drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c:203:2: error: implicit declaration of function 'nfp_resource_relase'; did you mean 'nfp_resource_release'? [-Werror=implicit-function-declaration]
     nfp_resource_relase(res);
     ^~~~~~~~~~~~~~~~~~~
     nfp_resource_release
   cc1: some warnings being treated as errors

vim +203 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c

   139	
   140	/**
   141	 * nfp_resource_acquire() - Acquire a resource handle
   142	 * @cpp:	NFP CPP handle
   143	 * @name:	Name of the resource
   144	 *
   145	 * NOTE: This function locks the acquired resource
   146	 *
   147	 * Return: NFP Resource handle, or ERR_PTR()
   148	 */
   149	struct nfp_resource *
   150	nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
   151	{
   152		unsigned long warn_at = jiffies + NFP_MUTEX_WAIT_FIRST_WARN * HZ;
   153		unsigned long err_at = jiffies + NFP_MUTEX_WAIT_ERROR * HZ;
   154		struct nfp_cpp_mutex *dev_mutex;
   155		struct nfp_resource *res;
   156		int err;
   157	
   158		res = kzalloc(sizeof(*res), GFP_KERNEL);
   159		if (!res)
   160			return ERR_PTR(-ENOMEM);
   161	
   162		strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
   163	
   164		dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
   165						NFP_RESOURCE_TBL_BASE,
   166						NFP_RESOURCE_TBL_KEY);
   167		if (!dev_mutex) {
   168			kfree(res);
   169			return ERR_PTR(-ENOMEM);
   170		}
   171	
   172		for (;;) {
   173			err = nfp_resource_try_acquire(cpp, res, dev_mutex);
   174			if (!err)
   175				break;
   176			if (err != -EBUSY)
   177				goto err_free;
   178	
   179			err = msleep_interruptible(1);
   180			if (err != 0) {
   181				err = -ERESTARTSYS;
   182				goto err_free;
   183			}
   184	
   185			if (time_is_before_eq_jiffies(warn_at)) {
   186				warn_at = jiffies + NFP_MUTEX_WAIT_NEXT_WARN * HZ;
   187				nfp_warn(cpp, "Warning: waiting for NFP resource %s\n",
   188					 name);
   189			}
   190			if (time_is_before_eq_jiffies(err_at)) {
   191				nfp_err(cpp, "Error: resource %s timed out\n", name);
   192				err = -EBUSY;
   193				goto err_free;
   194			}
   195		}
   196	
   197		nfp_cpp_mutex_free(dev_mutex);
   198	
   199		return res;
   200	
   201	err_free:
   202		nfp_cpp_mutex_free(dev_mutex);
 > 203		nfp_resource_relase(res);
   204		return ERR_PTR(err);
   205	}
   206	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49541 bytes --]

      parent reply	other threads:[~2020-04-20  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 15:02 [PATCH] nfp: Fix memory leak in nfp_resource_acquire() Keita Suzuki
2020-04-09 17:18 ` David Miller
2020-04-09 17:38   ` Keita Suzuki
2020-04-09 17:41 ` Keita Suzuki
2020-04-09 19:32   ` Jakub Kicinski
2020-04-10  5:21     ` Keita Suzuki
2020-04-20  7:49 ` kbuild test robot [this message]

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=202004201549.0EZ6dyQ7%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@lists.01.org \
    --cc=keitasuzuki.park@sslab.ics.keio.ac.jp \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=takafumi.kubota1012@sslab.ics.keio.ac.jp \
    /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).