diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2015-06-30 13:15:31 -0600 |
---|---|---|
committer | Peter Huewe <peterhuewe@gmx.de> | 2015-07-13 23:33:57 +0200 |
commit | ba0ef85479c46a2ab354c2220bdb6152f7f4baf3 (patch) | |
tree | bcd66fd63ce3ba231baa834380cc55df4c00d631 /drivers/char/tpm/tpm_crb.c | |
parent | b3bddffd35a0b77eee89760eb94cafa18dc431f5 (diff) |
tpm: Fix initialization of the cdev
When a cdev is contained in a dynamic structure the cdev parent kobj
should be set to the kobj that controls the lifetime of the enclosing
structure. In TPM's case this is the embedded struct device.
Also, cdev_init 0's the whole structure, so all sets must be after,
not before. This fixes module ref counting and cdev.
Cc: <stable@vger.kernel.org>
Fixes: 313d21eeab92 ("tpm: device class for tpm")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'drivers/char/tpm/tpm_crb.c')
0 files changed, 0 insertions, 0 deletions