Skip to content

drivers: adc: ad463x: fix resource leak in ad463x_init error paths#3064

Merged
buha merged 1 commit intomainfrom
staging/bug-6-fix-ad463x-resource-leak
Apr 20, 2026
Merged

drivers: adc: ad463x: fix resource leak in ad463x_init error paths#3064
buha merged 1 commit intomainfrom
staging/bug-6-fix-ad463x-resource-leak

Conversation

@amiclaus
Copy link
Copy Markdown
Contributor

@amiclaus amiclaus commented Apr 8, 2026

Four ad463x_spi_reg_write_masked() calls for mode configuration use bare return statements instead of goto error_spi, bypassing cleanup of the SPI descriptor, clock generator, GPIOs and device descriptor. Replace return with goto error_spi to use the existing cleanup chain.

Fixes: fe417e1 ("adc: ad463x: initial commit")

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have complied with the Submission Checklist
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

Four ad463x_spi_reg_write_masked() calls for mode configuration use
bare return statements instead of goto error_spi, bypassing cleanup
of the SPI descriptor, clock generator, GPIOs and device descriptor.
Replace return with goto error_spi to use the existing cleanup chain.

Fixes: fe417e1 ("adc: ad463x: initial commit")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
@buha buha merged commit ac6f6e9 into main Apr 20, 2026
16 of 19 checks passed
@buha buha deleted the staging/bug-6-fix-ad463x-resource-leak branch April 20, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants