Skip to content

solidigm: fix unchecked return value in ilog_dump_pel() - #3972

Open
sahmed-ibm wants to merge 1 commit into
linux-nvme:masterfrom
sahmed-ibm:fix-solidigm-internal-logs-unchecked-return
Open

solidigm: fix unchecked return value in ilog_dump_pel()#3972
sahmed-ibm wants to merge 1 commit into
linux-nvme:masterfrom
sahmed-ibm:fix-solidigm-internal-logs-unchecked-return

Conversation

@sahmed-ibm

Copy link
Copy Markdown
Contributor

The ilog_dump_pel() function calls nvme_get_log_persistent_event() with NVME_PEVENT_LOG_RELEASE_CTX as the final step to release the persistent event log context on the device. The return value of this call was not checked.

If the release call fails, the device-side context is left open. Any subsequent attempt to establish a new context may fail or behave unexpectedly.

Use a goto to ensure the release call is always reached and its return value is captured and returned to the caller.

The ilog_dump_pel() function calls nvme_get_log_persistent_event()
with NVME_PEVENT_LOG_RELEASE_CTX as the final step to release the
persistent event log context on the device. The return value of
this call was not checked.

If the release call fails, the device-side context is left open.
Any subsequent attempt to establish a new context may fail or
behave unexpectedly.

Use a goto to ensure the release call is always reached and its
return value is captured and returned to the caller.

Signed-off-by: Sarah Ahmed <sarah.ahmed@ibm.com>
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