EON Steel: fix uninitialized field cache entries
The check for whether we had initialized a field in the EON Steel cache data structure was wrong, causing some entries to be returned successfully even if their field had never been initialized. In most cases, it didn't matter, since the cache data was initialized to zero (which is a fine default for uninitialized data), so most of the time it didn't matter. But for the recently added dive mode field, this caused OC dives to be returned as freedives, for example. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c6b681a753
commit
42601825aa
@ -955,7 +955,7 @@ suunto_eonsteel_parser_get_field(dc_parser_t *parser, dc_field_type_t type, unsi
|
||||
|
||||
suunto_eonsteel_parser_t *eon = (suunto_eonsteel_parser_t *)parser;
|
||||
|
||||
if (!(eon->cache.initialized >> type))
|
||||
if (!(eon->cache.initialized & (1 << type)))
|
||||
return DC_STATUS_UNSUPPORTED;
|
||||
|
||||
switch (type) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user