Skip to content

accel/amdxdna: initialize ret to -ENOENT in aie tile access helpers#1509

Open
NishadSaraf wants to merge 1 commit into
amd:mainfrom
NishadSaraf:fix
Open

accel/amdxdna: initialize ret to -ENOENT in aie tile access helpers#1509
NishadSaraf wants to merge 1 commit into
amd:mainfrom
NishadSaraf:fix

Conversation

@NishadSaraf

Copy link
Copy Markdown
Member

Initialize ret to -ENOENT in amdxdna_get_coredump(), amdxdna_aie_tile_read() and amdxdna_aie_tile_write() so that the subsequent 'if (ret == -ENOENT)' check and 'return ret' are well defined even if the amdxdna_for_each_client loop body never executes. This makes each function locally correct instead of relying on the calling client always being present in client_list, and silences static-analysis warnings about reading an uninitialized variable.

Initialize ret to -ENOENT in amdxdna_get_coredump(), amdxdna_aie_tile_read()
and amdxdna_aie_tile_write() so that the subsequent 'if (ret == -ENOENT)'
check and 'return ret' are well defined even if the amdxdna_for_each_client
loop body never executes. This makes each function locally correct instead
of relying on the calling client always being present in client_list, and
silences static-analysis warnings about reading an uninitialized variable.

Signed-off-by: Nishad Saraf <nishads@amd.com>
Copilot AI review requested due to automatic review settings July 17, 2026 20:23
@NishadSaraf NishadSaraf self-assigned this Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the AIE “tile access” and coredump helper paths locally correct by ensuring ret is initialized to -ENOENT before iterating clients, preventing an undefined read when the amdxdna_for_each_client() loop executes zero iterations.

Changes:

  • Initialize ret to -ENOENT in amdxdna_get_coredump().
  • Initialize ret to -ENOENT in amdxdna_aie_tile_read().
  • Initialize ret to -ENOENT in amdxdna_aie_tile_write().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants