summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-10-15 11:23:45 -0500
committerJohn Klug <john.klug@multitech.com>2020-10-16 10:53:27 -0500
commit588b6041267bd12227891881c2c78c8b73ae1024 (patch)
tree46303dfa12efb33ae3824c10caf604aef6f4910d
parentae6b8d4b3111e7a2952c8ae2548b3276c6ba5648 (diff)
downloadmts-io-noradio-fix.tar.gz
mts-io-noradio-fix.tar.bz2
mts-io-noradio-fix.zip
Fix the length of the attributes for MTCAP4.3.3bnoradio-fix
-rw-r--r--io-module/mts-io.c7
-rw-r--r--io-module/mts_io_module.h2
2 files changed, 5 insertions, 4 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;
}
}
diff --git a/io-module/mts_io_module.h b/io-module/mts_io_module.h
index 4050432..220639d 100644
--- a/io-module/mts_io_module.h
+++ b/io-module/mts_io_module.h
@@ -5,7 +5,7 @@
* MTAC cards.
*/
-#define DRIVER_VERSION "v4.3.3a"
+#define DRIVER_VERSION "v4.3.3b"
#define DRIVER_AUTHOR "Multitech Systems"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"