From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
Marcel Selhorst <tpmdd@selhorst.net>,
"moderated list:TPM DEVICE DRIVER"
<tpmdd-devel@lists.sourceforge.net>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: fix compat 'ppi' link handling in tpm_chip_register()
Date: Mon, 9 Nov 2015 15:47:20 -0700 [thread overview]
Message-ID: <20151109224720.GD1305@obsidianresearch.com> (raw)
In-Reply-To: <1446969067-29016-1-git-send-email-jarkko.sakkinen@linux.intel.com>
On Sun, Nov 08, 2015 at 09:51:07AM +0200, Jarkko Sakkinen wrote:
> + if (rc && rc != -ENOENT) {
> + tpm_chip_unregister(chip);
> + return rc;
> + }
> + }
This is still goofy looking, the list_add_tail_rcu should be the last
thing done and cannot fail. Just code this with the usual goto based
unwind and goto to do tpm_dev_del_device for the above failure.
> +
> return 0;
> out_err:
> tpm1_chip_unregister(chip);
Which avoids calling tpm1_chip_unregister and tpm_chip_unregister in
the same function, which looks so wrong to a casual read..
Jason
next prev parent reply other threads:[~2015-11-09 22:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-08 7:51 [PATCH] tpm: fix compat 'ppi' link handling in tpm_chip_register() Jarkko Sakkinen
2015-11-09 22:47 ` Jason Gunthorpe [this message]
2015-11-10 4:02 ` Jarkko Sakkinen
2015-11-10 6:11 ` Jeremiah Mahler
2015-11-10 6: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=20151109224720.GD1305@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=tpmdd-devel@lists.sourceforge.net \
--cc=tpmdd@selhorst.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.