From: kernel test robot <lkp@intel.com>
To: Sergey Temerkhanov <s.temerkhanov@gmail.com>,
Peter Huewe <peterhuewe@gmx.de>,
Jarkko Sakkinen <jarkko@kernel.org>,
Jason Gunthorpe <jgg@ziepe.ca>,
Jerry Snitselaar <jsnitsel@redhat.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH v2] tpm: Rework open/close/shutdown to avoid races
Date: Wed, 16 Dec 2020 01:08:39 +0800 [thread overview]
Message-ID: <202012160142.uJm4cvD6-lkp@intel.com> (raw)
In-Reply-To: <20201215133801.546207-1-s.temerkhanov@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2804 bytes --]
Hi Sergey,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on linux/master linus/master v5.10 next-20201215]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Sergey-Temerkhanov/tpm-Rework-open-close-shutdown-to-avoid-races/20201215-214304
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 93f998879cd95b3e4f2836e7b17d6d5ae035cf90
config: m68k-randconfig-r012-20201215 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/b1f6f05f320b6b609ff70567a701e12504783b02
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sergey-Temerkhanov/tpm-Rework-open-close-shutdown-to-avoid-races/20201215-214304
git checkout b1f6f05f320b6b609ff70567a701e12504783b02
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/char/tpm/tpm-dev.c: In function 'tpm_open':
>> drivers/char/tpm/tpm-dev.c:22:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
22 | int ret = 0;
| ^~~
vim +/ret +22 drivers/char/tpm/tpm-dev.c
17
18 static int tpm_open(struct inode *inode, struct file *file)
19 {
20 struct tpm_chip *chip;
21 struct file_priv *priv;
> 22 int ret = 0;
23
24 chip = container_of(inode->i_cdev, struct tpm_chip, cdev);
25
26 /* It's assured that the chip will be opened just once,
27 * by the check of the chip reference count.
28 */
29 if (atomic_fetch_inc(&chip->refcount)) {
30 dev_dbg(&chip->dev, "Another process owns this TPM\n");
31 ret = -EBUSY;
32 goto out;
33 }
34
35 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
36 if (priv == NULL) {
37 ret = -ENOMEM;
38 goto out;
39 }
40
41 tpm_common_open(file, chip, priv, NULL);
42
43 return 0;
44
45 out:
46 atomic_dec(&chip->refcount);
47 wake_up_all(&chip->waitq);
48 return -ENOMEM;
49 }
50
---
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: 15867 bytes --]
next prev parent reply other threads:[~2020-12-15 17:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 13:38 [PATCH v2] tpm: Rework open/close/shutdown to avoid races Sergey Temerkhanov
2020-12-15 17:08 ` kernel test robot [this message]
2020-12-15 17:56 ` Jason Gunthorpe
2020-12-15 18:51 ` James Bottomley
2020-12-17 21:05 ` James Bottomley
2022-03-07 15:41 ` Jarkko Sakkinen
2022-03-07 16:22 ` James Bottomley
2022-03-07 16:44 ` Jarkko Sakkinen
2022-03-07 16:45 ` Jarkko Sakkinen
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=202012160142.uJm4cvD6-lkp@intel.com \
--to=lkp@intel.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=jsnitsel@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=s.temerkhanov@gmail.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).