leds: flash: qcom: correct the cleanup indexing
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 of 2 patches 1 replyIn review
1 of 2 patches is in this archive. The cover letter announces 2.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | leds: flash: qcom: correct the cleanup indexingdrivers/ | +17 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] leds: flash: qcom: correct the cleanup indexing
The cleanup of the qcom flash controller walks the LEDs that are registered with it and frees the slots it finds. It counted the entries first and decremented the count before it used the index, so the last entry was left registered and the next registration of an LED reused that slot.
The cleanup also stopped at the first NULL slot. A torch-only LED, and a configuration without the V4L2 wrapper, leave NULL entries behind, and v4l2_flash_release() already accepts them. The cleanup now releases every slot that is registered and ignores the empty ones.
The fix was found on the Xiaomi Pad 8 Pro, whose camera flash uses this controller. The commit was prepared by slwyts for the support of the Focus Pen Pro; the original commit and its address are in the message of the patch itself.
---
2.43.0