diff mbox

hdat/i2c: Fix array version check

Message ID 20170720021303.24698-1-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran July 20, 2017, 2:13 a.m. UTC
We should be checking the array version, not the HDIF header version.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hdata/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stewart Smith July 25, 2017, 8:23 a.m. UTC | #1
Oliver O'Halloran <oohall@gmail.com> writes:
> We should be checking the array version, not the HDIF header version.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Merged to master as of ce2153b7fe91699b26c9a679d6c5670b7b2a4545
diff mbox

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 62933e65b7a5..1c26e2ea9df0 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -190,7 +190,7 @@  int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		version = 1;
 		prerror("I2C: HDAT device array has no version! Assuming v1\n");
 	} else {
-		version = be32_to_cpu(hdr->version);
+		version = be32_to_cpu(ahdr->version);
 	}
 
 	if (version != 1) {