[PATCH linux dev-4.7 v2] drivers: fsi: Copy all data out

Eddie James eajames at linux.vnet.ibm.com
Tue Feb 21 10:00:48 AEDT 2017


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

Driver was only copying 32 bits out to the user-provided data pointer.

since v1:
 * don't do a for loop... thanks Milton.

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

diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
index 3ed82ea..8c8a8f4 100644
--- a/drivers/fsi/fsi-master-gpio.c
+++ b/drivers/fsi/fsi-master-gpio.c
@@ -274,7 +274,7 @@ static int poll_for_response(struct fsi_master_gpio *master, uint8_t expected,
 			resp <<= bits_remaining;
 			resp |= response.msg;
 			bits_received += bits_remaining;
-			*((uint32_t *)data) = response.msg;
+			memcpy(data, &response.msg, size);
 		}
 
 		crc_in = fsi_crc4(0, resp | (0x1ULL << bits_received),
-- 
1.8.3.1



More information about the openbmc mailing list