Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1333417
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get |
| Date | 2016-02-14 06:00 +0100 |
| Message-ID | <r1WWS-6oa-1@gated-at.bofh.it> (permalink) |
| References | <r1vWF-5KL-7@gated-at.bofh.it> <r1vWG-5KL-21@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
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>
I'm bit confused about this patch. What is the regression if this needs
to be dropped from my last pull request for 4.5 (that is the only one
I'm planning to include from this patch set, rest are definitely
post-4.5)?
If there is clear regression in this patch, I can do it. I didn't
reproduce any.
/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
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] Various struct device cleanups Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 01:10 +0100
[PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 01:10 +0100
Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-13 11:10 +0100
Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 16:50 +0100
Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-14 06:00 +0100
Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-14 08:00 +0100
Re: [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-14 09:10 +0100
[PATCH 3/3] tpm: Get rid of devname Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 01:10 +0100
Re: [PATCH 3/3] tpm: Get rid of devname Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 02:20 +0100
Re: [PATCH 3/3] tpm: Get rid of devname Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-14 06:20 +0100
[PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 01:10 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 02:20 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 03:10 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-13 04:40 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-14 06:30 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-14 08:00 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-14 09:10 +0100
Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev Stefan Berger <stefanb@linux.vnet.ibm.com> - 2016-02-13 16:50 +0100
Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-02-14 08:10 +0100
Re: [PATCH 2/3] tpm: Get rid of chip->pdev Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-02-14 06:20 +0100
csiph-web