lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Nov 2015 06:02:54 +0200
From:	Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Cc:	Peter Huewe <peterhuewe@....de>,
	Marcel Selhorst <tpmdd@...horst.net>,
	"moderated list:TPM DEVICE DRIVER" 
	<tpmdd-devel@...ts.sourceforge.net>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tpm: fix compat 'ppi' link handling in
 tpm_chip_register()

On Mon, Nov 09, 2015 at 03:47:20PM -0700, Jason Gunthorpe wrote:
> 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.

Agreed that this would be cleaner.

> > +
> >  	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..

I'm not going to change the current patch at this point of release
cycle but this clean up definitely makes sense later on.

> Jason

/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ