Skip to contentSkip to conversation

tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()

PATCH In review Xiu Jianfeng 3 participants 4 messages Mar 18, 2022 – Mar 20, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()

Currently it returns zero when CRQ response timed out, it should return an error code instead.

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 3af4c07a9342..d3989b257f42 100644
@@ -681,6 +681,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
 	if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
 				ibmvtpm->rtce_buf != NULL,
 				HZ)) {
+		rc = -ENODEV;
 		dev_err(dev, "CRQ response timed out\n");
 		goto init_irq_cleanup;
 	}
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Xiu Jianfeng

Currently it returns zero when CRQ response timed out, it should return an error code instead.

Fixes d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before proceeding")
Quoted 16 lines
---
  drivers/char/tpm/tpm_ibmvtpm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/char/tpm/tpm_ibmvtpm.c +1 -0
index 3af4c07a9342..d3989b257f42 100644
@@ -681,6 +681,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
  	if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
  				ibmvtpm->rtce_buf != NULL,
  				HZ)) {
+		rc = -ENODEV;
  		dev_err(dev, "CRQ response timed out\n");
  		goto init_irq_cleanup;
  	}
maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Xiu Jianfeng
Quoted 24 lines · Xiu Jianfeng

Currently it returns zero when CRQ response timed out, it should return an error code instead.

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 3af4c07a9342..d3989b257f42 100644
@@ -681,6 +681,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
 	if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
 				ibmvtpm->rtce_buf != NULL,
 				HZ)) {
+		rc = -ENODEV;
 		dev_err(dev, "CRQ response timed out\n");
 		goto init_irq_cleanup;
 	}
Signature · 1 line
2.17.1

This will require reviewed by from someone who knows this driver better.

BR, Jarkko