diff options
Diffstat (limited to 'io-module/mts-io.c')
-rw-r--r-- | io-module/mts-io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c index 0937342..0a511ff 100644 --- a/io-module/mts-io.c +++ b/io-module/mts-io.c @@ -667,7 +667,7 @@ mts_id_eeprom_load(void) ((tmp=HW_VERSION_MTCAP_0_2),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0) || ((tmp=HW_VERSION_MTCAP_0_3),strncmp(id_eeprom.hw_version, tmp, strlen(tmp)) == 0)) { current_blength = attr_blength = sizeof mtcap_0_0_platform_attributes; - current_blength -= sizeof(struct attribute *); /* Length without terminating NULL */ + current_blength -= sizeof(struct attribute *); /* Length without terminating NULL */ /* See if we have no radio, and if so, prune out the stuff that follows */ if(noradio) { struct attribute **ap = mtcap_0_0_platform_attribute_group.attrs; @@ -680,8 +680,9 @@ mts_id_eeprom_load(void) if (is_radio_power_attr_mtcap(ap[j])) { log_info("Pruning radio feature from mts-io",j); ap[j] = NULL; - current_blength = attr_blength = j * sizeof (ap[j]); - /* account for removed attributes in table length */ + current_blength = j * sizeof (ap[j]); /* Size without NULL */ + attr_blength += sizeof (ap[j]); /* Size of attr array with NULL */ + /* account for removed attributes in table length */ break; } } |