RDKB-6577 - #1317
Open
Kondamma12345 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses several static-analysis (Coverity) findings across the WiFi stack by tightening error handling and cleanup paths in mesh connection logic, DML/passpoint JSON parsing, OVSDB selection, and various controller/app handlers.
Changes:
- Add missing allocation-failure handling and improve candidate list bookkeeping/cleanup for mesh STA scan results.
- Fix multiple memory/resource leaks (cJSON objects, OVSDB record buffers, temporary strings) and adjust OVSDB select API to avoid returning freed pointers.
- Minor logic correction for TR-181 radio index validation in the LEVL event handler.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| source/services/mesh/wifi_service_mesh.c | Handle malloc failure for scan candidate list; compute scan_count from actual candidates; free list when no candidates found. |
| source/dml/tr_181/ml/cosa_wifi_dml.c | Ensure parsed cJSON roots are deleted; free RFC string from PSM on success path. |
| source/db/wifi_db_apis.c | Avoid using empty select results; free selected schema records on error paths and before returning. |
| source/core/wifi_passpoint.c | Delete passPointCfg cJSON on HAL-update failure path; minor preprocessor whitespace cleanup. |
| source/core/wifi_ctrl_webconfig.c | Free webconfig subdoc data consistently after encoding/pushing event. |
| source/core/wifi_ctrl_rbus_handlers.c | Free harvester buffer on allocation failure to avoid leaks. |
| source/core/services/vap_svc_mesh_ext.c | Add malloc failure handling; track scan_count as actual appended candidates. |
| source/apps/levl/wifi_levl.c | Tighten radio index validation to match 1-based TR-181 instance numbering. |
| lib/ovsdb/ovsdb_table.c | Return NULL on failure instead of returning a potentially freed records pointer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1868
to
1870
| if ((radio < 1) || (radio > MAX_NUM_RADIOS)) { | ||
| wifi_util_dbg_print(WIFI_APPS, "%s:%d Invalid Radio: %u\n", __func__, __LINE__, radio-1); | ||
| pthread_mutex_unlock(&wifi_app->data.u.levl.lock); |
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.
Reason for change: Fixing coverity issues.
Test Procedure: Build should be successful and the regression test should also succeed.
Risks: Low
Priority: P1
Signed-off-by: Kondamma_Kudumula@comcast.com