aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/csr1212.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/csr1212.c')
-rw-r--r--drivers/ieee1394/csr1212.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c
index 586f71e7346a..c28f639823d2 100644
--- a/drivers/ieee1394/csr1212.c
+++ b/drivers/ieee1394/csr1212.c
@@ -47,14 +47,14 @@
47#define __D (1 << CSR1212_KV_TYPE_DIRECTORY) 47#define __D (1 << CSR1212_KV_TYPE_DIRECTORY)
48#define __L (1 << CSR1212_KV_TYPE_LEAF) 48#define __L (1 << CSR1212_KV_TYPE_LEAF)
49static const u_int8_t csr1212_key_id_type_map[0x30] = { 49static const u_int8_t csr1212_key_id_type_map[0x30] = {
50 0, /* Reserved */ 50 __C, /* used by Apple iSight */
51 __D | __L, /* Descriptor */ 51 __D | __L, /* Descriptor */
52 __I | __D | __L, /* Bus_Dependent_Info */ 52 __I | __D | __L, /* Bus_Dependent_Info */
53 __I | __D | __L, /* Vendor */ 53 __I | __D | __L, /* Vendor */
54 __I, /* Hardware_Version */ 54 __I, /* Hardware_Version */
55 0, 0, /* Reserved */ 55 0, 0, /* Reserved */
56 __D | __L, /* Module */ 56 __D | __L | __I, /* Module */
57 0, 0, 0, 0, /* Reserved */ 57 __I, 0, 0, 0, /* used by Apple iSight, Reserved */
58 __I, /* Node_Capabilities */ 58 __I, /* Node_Capabilities */
59 __L, /* EUI_64 */ 59 __L, /* EUI_64 */
60 0, 0, 0, /* Reserved */ 60 0, 0, 0, /* Reserved */
@@ -1234,6 +1234,12 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr)
1234 csr->private); 1234 csr->private);
1235 if (ret != CSR1212_SUCCESS) 1235 if (ret != CSR1212_SUCCESS)
1236 return ret; 1236 return ret;
1237
1238 /* check ROM header's info_length */
1239 if (i == 0 &&
1240 CSR1212_BE32_TO_CPU(csr->cache_head->data[0]) >> 24 !=
1241 bytes_to_quads(csr->bus_info_len) - 1)
1242 return CSR1212_EINVAL;
1237 } 1243 }
1238 1244
1239 bi = (struct csr1212_bus_info_block_img*)csr->cache_head->data; 1245 bi = (struct csr1212_bus_info_block_img*)csr->cache_head->data;
@@ -1250,9 +1256,6 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr)
1250 return ret; 1256 return ret;
1251 } 1257 }
1252 1258
1253 if (bytes_to_quads(csr->bus_info_len - sizeof(csr1212_quad_t)) != bi->length)
1254 return CSR1212_EINVAL;
1255
1256#if 0 1259#if 0
1257 /* Apparently there are too many differnt wrong implementations of the 1260 /* Apparently there are too many differnt wrong implementations of the
1258 * CRC algorithm that verifying them is moot. */ 1261 * CRC algorithm that verifying them is moot. */