vTPM: set virtual device before passing to ibmvtpm_reset_crq
authorHon Ching \(Vicky\) Lo <honclo@linux.vnet.ibm.com>
Fri, 22 May 2015 17:23:02 +0000 (13:23 -0400)
committerPeter Huewe <peterhuewe@gmx.de>
Tue, 16 Jun 2015 21:26:59 +0000 (23:26 +0200)
tpm_ibmvtpm_probe() calls ibmvtpm_reset_crq(ibmvtpm) without having yet
set the virtual device in the ibmvtpm structure. So in ibmvtpm_reset_crq,
the phype call contains empty unit addresses, ibmvtpm->vdev->unit_address.

Signed-off-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Ashley Lai <ashley@ahsleylai.com>
Cc: <stable@vger.kernel.org>
Fixes: 132f76294744 ("drivers/char/tpm: Add new device driver to support IBM vTPM")
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
drivers/char/tpm/tpm_ibmvtpm.c

index 42ffa5e7a1e0f6c912a0e214e67a3a99d1511a08..27ebf9511cb41cdf5e26fc1f82a65ecab9a60d33 100644 (file)
@@ -578,6 +578,9 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
                goto cleanup;
        }
 
+       ibmvtpm->dev = dev;
+       ibmvtpm->vdev = vio_dev;
+
        crq_q = &ibmvtpm->crq_queue;
        crq_q->crq_addr = (struct ibmvtpm_crq *)get_zeroed_page(GFP_KERNEL);
        if (!crq_q->crq_addr) {
@@ -622,8 +625,6 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
 
        crq_q->index = 0;
 
-       ibmvtpm->dev = dev;
-       ibmvtpm->vdev = vio_dev;
        TPM_VPRIV(chip) = (void *)ibmvtpm;
 
        spin_lock_init(&ibmvtpm->rtce_lock);