Skip to contentSkip to conversation

tpm: ibmvtpm: fix error return code in tpm_ibmvtpm_probe()

PATCH In review Wang Hai 3 participants 4 messages Nov 24, 2020 – Dec 22, 2020

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 tpm: ibmvtpm: fix error return code in tpm_ibmvtpm_probe()

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before proceeding")
---
 drivers/char/tpm/tpm_ibmvtpm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/char/tpm/tpm_ibmvtpm.c +1 -0
index 994385bf37c0..813eb2cac0ce 100644
@@ -687,6 +687,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
 				ibmvtpm->rtce_buf != NULL,
 				HZ)) {
 		dev_err(dev, "CRQ response timed out\n");
+		rc = -ETIMEDOUT;
 		goto init_irq_cleanup;
 	}
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Wang Hai

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before proceeding")
---
  drivers/char/tpm/tpm_ibmvtpm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/char/tpm/tpm_ibmvtpm.c +0 -0
index 994385bf37c0..813eb2cac0ce 100644

drivers/char/tpm/tpm_ibmvtpm.c static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, · line 693

Quoted 7 lines
drivers/char/tpm/tpm_ibmvtpm.c +1 -0
@@ -687,6 +687,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
  				ibmvtpm->rtce_buf != NULL,
  				HZ)) {
  		dev_err(dev, "CRQ response timed out\n");
+		rc = -ETIMEDOUT;
  		goto init_irq_cleanup;
  	}
 
maintainer
#2 lore raw
In reply to Wang Hai
Quoted 7 lines · Wang Hai

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before

proceeding")

Provide a reasoning for -ETIMEOUT in the commit message.

/Jarkko

Quoted 18 lines

---
 drivers/char/tpm/tpm_ibmvtpm.c | 1 +

 1 file changed, 1 insertion(+)
drivers/char/tpm/tpm_ibmvtpm.c +1 -0
index 994385bf37c0..813eb2cac0ce 100644
@@ -687,6 +687,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev
 *vio_dev,
                                 ibmvtpm->rtce_buf != NULL,
                                 HZ)) {
                 dev_err(dev, "CRQ response timed out\n");
+               rc = -ETIMEDOUT;
                 goto init_irq_cleanup;
         }

#3 lore raw
Quoted 11 lines · Jarkko Sakkinen
Quoted 7 lines · Wang Hai

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before

proceeding")

Provide a reasoning for -ETIMEOUT in the commit message.

/Jarkko

Was this patch ever applied? I don't seem to find the infradead git tree ...