summaryrefslogtreecommitdiff
path: root/io-module/mts-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io-module/mts-io.c')
-rw-r--r--io-module/mts-io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index 204fd9f..0f4854b 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -823,7 +823,8 @@ mts_id_eeprom_load(void)
if (is_radio_power_attr_mtcdt(ap[j])) {
log_info("Pruning radio feature from mts-io",j);
ap[j] = NULL;
- current_blength = attr_blength = j * sizeof (ap[j]);
+ current_blength = j * sizeof (ap[j]); /* Size without NULL */
+ attr_blength += sizeof (ap[j]); /* Size of attr array with NULL */
break;
}
}
@@ -835,7 +836,7 @@ mts_id_eeprom_load(void)
if(DEVICE_CAPA(id_eeprom.capa, CAPA_GPS)) {
attr_blength += sizeof mtcdt_0_1_gnss_attributes;
}
- if (current_blength+(sizeof(struct attribute *)) != attr_blength) {
+ if (current_blength+(sizeof(struct attribute *)) != attr_blength) {
freelater = all_attrs = kmalloc(attr_blength,GFP_KERNEL);
current_count = current_blength/(sizeof (struct attribute *));
memcpy(all_attrs,mtcdt_0_1_platform_attributes,current_blength);
@@ -874,7 +875,8 @@ mts_id_eeprom_load(void)
if (is_radio_power_attr_mtcdt(ap[j])) {
log_info("Pruning radio feature from mts-io",j);
ap[j] = NULL;
- current_blength = attr_blength = j * sizeof (ap[j]);
+ current_blength = j * sizeof (ap[j]); /* Size without NULL */
+ attr_blength += sizeof (ap[j]); /* Size of attr array with NULL */
break;
}
}