Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HID device open failure handling #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 25, 2020

  1. Fix HID device open failure handling

    When the ACM device could be opened to restart into the bootloader, but
    the HID device was detected but failed to open (for example because of a
    permission problem), this would not be detected and the code would
    segfault because `handle` was NULL.
    
    The code that was supposed to handle a NULL return value from `hid_open`
    actually triggered only on a *non-null* value, and apparently also only
    when the "looking for hid device" loop above had reached i = 10 (in
    which case some error handling above would have bailed out already).
    
    This changes the code to just check for a NULL return value, and bail
    out in that case.
    matthijskooijman committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    63cd68e View commit details
    Browse the repository at this point in the history