From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
Stefan Berger <stefanb@us.ibm.com>,
jmorris@namei.org
Subject: Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get
Date: Sat, 13 Feb 2016 08:45:59 -0700 [thread overview]
Message-ID: <fc8d20c0-0732-49e6-b05f-6f37d933a18f@email.android.com> (raw)
In-Reply-To: <20160213100818.GA12607@intel.com>
Hi Jarkko,
I found a bug in this last night, please hold off.
Jason
On Feb 13, 2016 3:08 AM, Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> wrote:
>
> On Fri, Feb 12, 2016 at 05:04:29PM -0700, Jason Gunthorpe wrote:
> > This was missed during the struct device conversion, we
> > need to hold a kref on the chip to make sure it isn't freed.
> >
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.cm>
>
> For rest of the patches I'll look at them post-v4.5. I'm still waiting
> for my first pull request containing fixes for that release to be
> taken.
>
> James, would it be possible to take the pull request containing fixes
> soon that I origianally sent already in Jan and bit updated version
> few days ago [1]? I still have one more pull request coming after that. It will
> contain only few line changes:
>
> * Missing put_device() in two places.
> * There is a small change to ABI behavior (I'll post it
> soon) of policy sealing so I really need it for this release because
> 4.5 is the first release containing this feature and I cannot change
> it when the release is tagged.
>
> Thank you.
>
> [1] http://www.gossamer-threads.com/lists/linux/kernel/2366902
>
> /Jarkko
>
>
> > ---
> > drivers/char/tpm/tpm-chip.c | 2 ++
> > drivers/char/tpm/tpm.h | 1 +
> > 2 files changed, 3 insertions(+)
> >
> > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
> > index 45cc39aabeee..ae2fed8a162b 100644
> > --- a/drivers/char/tpm/tpm-chip.c
> > +++ b/drivers/char/tpm/tpm-chip.c
> > @@ -53,6 +53,8 @@ struct tpm_chip *tpm_chip_find_get(int chip_num)
> > chip = pos;
> > break;
> > }
> > +
> > + get_device(&chip->dev);
> > }
> > rcu_read_unlock();
> > return chip;
> > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> > index 542a80cbfd9c..f6ba79d91857 100644
> > --- a/drivers/char/tpm/tpm.h
> > +++ b/drivers/char/tpm/tpm.h
> > @@ -207,6 +207,7 @@ struct tpm_chip {
> > static inline void tpm_chip_put(struct tpm_chip *chip)
> > {
> > module_put(chip->pdev->driver->owner);
> > + put_device(&chip->dev);
> > }
> >
> > static inline int tpm_read_index(int base, int index)
> > --
> > 2.1.4
> >
next prev parent reply other threads:[~2016-02-13 15:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-13 0:04 [PATCH 0/3] Various struct device cleanups Jason Gunthorpe
2016-02-13 0:04 ` [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jason Gunthorpe
2016-02-13 10:08 ` Jarkko Sakkinen
2016-02-13 15:45 ` Jason Gunthorpe [this message]
2016-02-14 4:55 ` Jarkko Sakkinen
2016-02-14 6:50 ` Jason Gunthorpe
2016-02-14 8:02 ` Jarkko Sakkinen
2016-02-13 0:04 ` [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe
[not found] ` <201602130037.u1D0bDEN029756@d01av04.pok.ibm.com>
2016-02-13 1:11 ` Jason Gunthorpe
[not found] ` <201602130128.u1D1S2Xn006955@d01av05.pok.ibm.com>
2016-02-13 2:00 ` Jason Gunthorpe
2016-02-13 3:33 ` Jason Gunthorpe
2016-02-14 5:24 ` Jarkko Sakkinen
2016-02-14 6:57 ` Jason Gunthorpe
2016-02-14 8:03 ` Jarkko Sakkinen
2016-02-13 15:39 ` [tpmdd-devel] " Stefan Berger
2016-02-14 7:06 ` Jason Gunthorpe
2016-02-14 5:13 ` Jarkko Sakkinen
2016-02-13 0:04 ` [PATCH 3/3] tpm: Get rid of devname Jason Gunthorpe
2016-02-13 1:01 ` kbuild test robot
2016-02-13 1:13 ` Jason Gunthorpe
2016-02-14 5:16 ` 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=fc8d20c0-0732-49e6-b05f-6f37d933a18f@email.android.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=stefanb@us.ibm.com \
--cc=tpmdd-devel@lists.sourceforge.net \
/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®