Skip to content

Handle MFCustomDevice::attach() failures in CustomDevice::Add() - #391

Open
elral wants to merge 1 commit into
mainfrom
fix_customdevice_alloc_error
Open

elral wants to merge 1 commit into
mainfrom
fix_customdevice_alloc_error

Conversation

@elral

@elral elral commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Description of changes

This PR updates CustomDevice::Add() to handle initialization failures reported by MFCustomDevice::attach().

Previously, a custom device was always counted as registered after calling attach(), even if the initialization of the underlying custom device had failed. This could leave an invalid or partially initialized device in the custom device list.

With this change:

  • CustomDevice::Add() checks the return value of MFCustomDevice::attach().
  • customDeviceRegistered is only incremented if the custom device was initialized successfully.
  • Invalid or partially initialized custom devices are no longer registered.

This change depends on the corresponding update in the separate custom device repository, where MFCustomDevice::attach() was changed to return a bool indicating whether initialization was successful.

Together, both changes ensure that only fully initialized custom devices are added to the registered device list.

@elral
elral requested a review from DocMoebiuz as a code owner September 3, 2026 09:11
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Board and firmware folder for this pull request:
Mobiflight-Firmware.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant