public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: peterhuewe@gmx.de, jarkko@kernel.org, stefanb@linux.vnet.ibm.com,
	James.Bottomley@hansenpartnership.com, David.Laight@ACULAB.COM,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	p.rosenberger@kunbus.com,
	Lino Sanfilippo <l.sanfilippo@kunbus.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v8 1/1] tpm: fix reference counting for struct tpm_chip
Date: Tue, 1 Mar 2022 10:05:44 -0400	[thread overview]
Message-ID: <20220301140544.GF6468@ziepe.ca> (raw)
In-Reply-To: <20220301022108.30310-2-LinoSanfilippo@gmx.de>

On Tue, Mar 01, 2022 at 03:21:08AM +0100, Lino Sanfilippo wrote:
> @@ -653,8 +623,10 @@ void tpm_chip_unregister(struct tpm_chip *chip)
>  	if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(chip))
>  		hwrng_unregister(&chip->hwrng);
>  	tpm_bios_log_teardown(chip);
> -	if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip))
> +	if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
>  		cdev_device_del(&chip->cdevs, &chip->devs);
> +		put_device(&chip->devs);
> +	}

I would put those two lines in a function bside tpm_devs_add() as
well, more modular.

It looks like a good idea to me

Jason

  parent reply	other threads:[~2022-03-01 14:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  2:21 [PATCH v8 0/1] tpm: fix reference counting for struct tpm_chip Lino Sanfilippo
2022-03-01  2:21 ` [PATCH v8 1/1] " Lino Sanfilippo
2022-03-01 12:36   ` Stefan Berger
2022-03-01 15:39     ` Lino Sanfilippo
2022-03-03 22:41     ` Jarkko Sakkinen
2022-03-01 14:05   ` Jason Gunthorpe [this message]
2022-03-01 16:18     ` Lino Sanfilippo
2022-03-01 13:56 ` [PATCH v8 0/1] " Stefan Berger
2022-03-01 15:45   ` Lino Sanfilippo

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=20220301140544.GF6468@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=David.Laight@ACULAB.COM \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=jarkko@kernel.org \
    --cc=l.sanfilippo@kunbus.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.rosenberger@kunbus.com \
    --cc=peterhuewe@gmx.de \
    --cc=stable@vger.kernel.org \
    --cc=stefanb@linux.vnet.ibm.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