[PATCH linux dev-4.7] drivers: fsi: scom: Zero out user buffer first

Eddie James eajames at linux.vnet.ibm.com
Wed Feb 22 04:02:10 AEDT 2017


From: "Edward A. James" <eajames at us.ibm.com>

Scom data is just bit-wise OR'd with the user buffer, so it needs to be
set to 0 first.

Signed-off-by: Edward A. James <eajames at us.ibm.com>
---
 drivers/fsi/fsi-scom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index 51b3dc3..ed3b98e 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -85,6 +85,7 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value,
 	uint32_t result, data;
 	int rc;
 
+	*value = 0ULL;
 	data = addr;
 	rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data,
 				sizeof(uint32_t));
-- 
1.8.3.1



More information about the openbmc mailing list