mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Xidong Wang <wangxidong_97@163.com>
Cc: kbuild-all@01.org,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Jack Wang <jinpu.wang@profitbricks.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Peter Senna Tschudin <peter.senna@collabora.com>,
	Hannes Reinecke <hare@suse.de>, Kees Cook <keescook@chromium.org>,
	Pan Bian <bianpan2016@163.com>,
	Xidong Wang <wangxidong_97@163.com>,
	Romain Perier <romain.perier@collabora.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] scsi: mvsas:fix memory leak
Date: Wed, 4 Apr 2018 18:53:22 +0800	[thread overview]
Message-ID: <201804041810.lcAdbGTD%fengguang.wu@intel.com> (raw)
In-Reply-To: <1522808120-11432-1-git-send-email-wangxidong_97@163.com>

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

Hi Xidong,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on v4.16 next-20180403]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Xidong-Wang/scsi-mvsas-fix-memory-leak/20180404-182132
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: i386-randconfig-x016-201813 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10:0,
                    from drivers/scsi/mvsas/mv_sas.h:29,
                    from drivers/scsi/mvsas/mv_init.c:27:
   drivers/scsi/mvsas/mv_init.c: In function 'mvs_pci_alloc':
   include/linux/compiler.h:58:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
     ^
   include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
>> drivers/scsi/mvsas/mv_init.c:373:2: note: in expansion of macro 'if'
     if (!mvi)
     ^~
   drivers/scsi/mvsas/mv_init.c:375:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      return NULL;
      ^~~~~~

vim +/if +373 drivers/scsi/mvsas/mv_init.c

20b09c29 Andy Yan           2009-05-08  362  
6f039790 Greg Kroah-Hartman 2012-12-21  363  static struct mvs_info *mvs_pci_alloc(struct pci_dev *pdev,
20b09c29 Andy Yan           2009-05-08  364  				const struct pci_device_id *ent,
20b09c29 Andy Yan           2009-05-08  365  				struct Scsi_Host *shost, unsigned int id)
20b09c29 Andy Yan           2009-05-08  366  {
84fbd0ce Xiangliang Yu      2011-05-24  367  	struct mvs_info *mvi = NULL;
20b09c29 Andy Yan           2009-05-08  368  	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
20b09c29 Andy Yan           2009-05-08  369  
b89e8f53 Xiangliang Yu      2011-05-24  370  	mvi = kzalloc(sizeof(*mvi) +
b89e8f53 Xiangliang Yu      2011-05-24  371  		(1L << mvs_chips[ent->driver_data].slot_width) *
b89e8f53 Xiangliang Yu      2011-05-24  372  		sizeof(struct mvs_slot_info), GFP_KERNEL);
20b09c29 Andy Yan           2009-05-08 @373  	if (!mvi)
549079d1 Xidong Wang        2018-04-04  374  		scsi_host_put(shost);
20b09c29 Andy Yan           2009-05-08  375  		return NULL;
dd4969a8 Jeff Garzik        2009-05-08  376  
20b09c29 Andy Yan           2009-05-08  377  	mvi->pdev = pdev;
20b09c29 Andy Yan           2009-05-08  378  	mvi->dev = &pdev->dev;
20b09c29 Andy Yan           2009-05-08  379  	mvi->chip_id = ent->driver_data;
20b09c29 Andy Yan           2009-05-08  380  	mvi->chip = &mvs_chips[mvi->chip_id];
20b09c29 Andy Yan           2009-05-08  381  	INIT_LIST_HEAD(&mvi->wq_list);
20b09c29 Andy Yan           2009-05-08  382  
20b09c29 Andy Yan           2009-05-08  383  	((struct mvs_prv_info *)sha->lldd_ha)->mvi[id] = mvi;
20b09c29 Andy Yan           2009-05-08  384  	((struct mvs_prv_info *)sha->lldd_ha)->n_phy = mvi->chip->n_phy;
20b09c29 Andy Yan           2009-05-08  385  
20b09c29 Andy Yan           2009-05-08  386  	mvi->id = id;
20b09c29 Andy Yan           2009-05-08  387  	mvi->sas = sha;
20b09c29 Andy Yan           2009-05-08  388  	mvi->shost = shost;
20b09c29 Andy Yan           2009-05-08  389  
b89e8f53 Xiangliang Yu      2011-05-24  390  	mvi->tags = kzalloc(MVS_CHIP_SLOT_SZ>>3, GFP_KERNEL);
b89e8f53 Xiangliang Yu      2011-05-24  391  	if (!mvi->tags)
b89e8f53 Xiangliang Yu      2011-05-24  392  		goto err_out;
b89e8f53 Xiangliang Yu      2011-05-24  393  
20b09c29 Andy Yan           2009-05-08  394  	if (MVS_CHIP_DISP->chip_ioremap(mvi))
20b09c29 Andy Yan           2009-05-08  395  		goto err_out;
20b09c29 Andy Yan           2009-05-08  396  	if (!mvs_alloc(mvi, shost))
20b09c29 Andy Yan           2009-05-08  397  		return mvi;
dd4969a8 Jeff Garzik        2009-05-08  398  err_out:
dd4969a8 Jeff Garzik        2009-05-08  399  	mvs_free(mvi);
dd4969a8 Jeff Garzik        2009-05-08  400  	return NULL;
dd4969a8 Jeff Garzik        2009-05-08  401  }
dd4969a8 Jeff Garzik        2009-05-08  402  

:::::: The code at line 373 was first introduced by commit
:::::: 20b09c2992fefbe78f8cede7b404fb143a413c52 [SCSI] mvsas: add support for 94xx; layout change; bug fixes

:::::: TO: Andy Yan <ayan@marvell.com>
:::::: CC: James Bottomley <James.Bottomley@HansenPartnership.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

  reply	other threads:[~2018-04-04 10:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04  2:15 Xidong Wang
2018-04-04 10:53 ` kbuild test robot [this message]
2018-04-04 11:39 ` kbuild test robot
2018-04-04  2:37 [PATCH 1/1] scsi:mvsas:fix " Xidong Wang

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=201804041810.lcAdbGTD%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=bianpan2016@163.com \
    --cc=hare@suse.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jinpu.wang@profitbricks.com \
    --cc=jthumshirn@suse.de \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.senna@collabora.com \
    --cc=romain.perier@collabora.com \
    --cc=wangxidong_97@163.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

all inboxes | Powered by JetHome®