10000 fishy code in shared-module/usb_hid/__init__.c · Issue #5247 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content
fishy code in shared-module/usb_hid/__init__.c #5247
Closed
@jepler

Description

@jepler

CircuitPython version

7.0 beta

Code/REPL

253         // Collect all the report buffers for this device.
254         for (size_t id_idx = 0; id_idx < hid_devices[device_idx].num_report_ids; id_idx++) {
255             gc_collect_ptr(hid_devices[id_idx].in_report_buffers[id_idx]);
256             gc_collect_ptr(hid_devices[id_idx].out_report_buffers[id_idx]);
257         }

Behavior

Scott & I spotted this while working on #5021 -- We think that the use of [id_idx] twice in each line is fishy and the first one should be [device_idx]

Description

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0