Repository navigation
Fix crash when ending an update for an unassigned device - #702
Open
shubham-x06 wants to merge 1 commit into
Open
shubham-x06 wants to merge 1 commit into
shubham-x06 wants to merge 1 commit into
Conversation
Checks whether a device is assigned before ending an update in pi_update_device_end and the RPC server handler, returning PI_STATUS_DEV_NOT_ASSIGNED if not assigned instead of causing a crash. Also fixes a typo in CLI update_device_end_hs and adds a regression test case. Closes p4lang#701 Signed-off-by: Shubham <shubhammittal0610@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
description
This change checks whether a device is assigned before ending a config update in
pi_update_device_endand__pi_update_device_end. If the device is not assigned, it returnsPI_STATUS_DEV_NOT_ASSIGNEDinstead of crashing (e.g., null pointer dereference on target backends like BMv2). It also adds a regression test to verify the behavior and fixes a command name typo in the CLI help text forupdate_device_end.scope
pi_update_device_endinsrc/pi.cto returnPI_STATUS_DEV_NOT_ASSIGNEDwhen the device is not assigned__pi_update_device_endinsrc/pi_rpc_server.cFrontendGeneric_UpdateDeviceUnassigned.Endintests/frontends/generic/test.cupdate_device_end_hsinCLI/device_commands.cFixes #701