Sync changes from develop branch#35
Sync changes from develop branch#35SanthoshGujulvajagadeesh wants to merge 6 commits intofeature/network_intelligencefrom
Conversation
RDKB-61956, RDKB-62450 : Fix coverity issues
Release/1.1.2
There was a problem hiding this comment.
Pull request overview
This PR syncs changes from the develop branch, primarily addressing Coverity issues (RDKB-61956, RDKB-62450) with various code quality and reliability improvements.
Key changes:
- Improved error handling and resource management with proper cleanup on allocation failures
- Enhanced thread safety with mutex protection for shared variables
- Added debug logging for eventfd read operations to improve troubleshooting
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| source/AdvSecurityDml/cujoagent_dcl_api.c | Added debug logging for read operations, improved resource cleanup in error paths, and fixed radio index initialization |
| source/AdvSecurityDml/cosa_adv_security_internal.c | Refactored memory allocation error handling with centralized cleanup, added mutex protection for logging period variable, fixed condition variable usage pattern, and improved snprintf return value checking |
| source/AdvSecurityDml/cosa_adv_security_dml.c | Added mutex protection for shared variable access and corrected return values from ANSC_STATUS to BOOL |
| CHANGELOG.md | Updated with version 1.1.2 release notes documenting the Coverity fixes and other recent changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| else { | ||
| CcspTraceDebug(("Read event fd %d bytes\n", nbytes)); | ||
| } |
There was a problem hiding this comment.
Inconsistent indentation: This else block uses spaces for indentation while the rest of the file appears to use proper indentation. The lines should be indented with the same style as the surrounding code.
| else { | |
| CcspTraceDebug(("Read event fd %d bytes\n", nbytes)); | |
| } | |
| else { | |
| CcspTraceDebug(("Read event fd %d bytes\n", nbytes)); | |
| } |
| } | ||
|
|
||
| if (syscfg_init() != 0) { | ||
| CcspTraceError(("%s: syscfg_init error", __FUNCTION__)); |
There was a problem hiding this comment.
Missing cleanup on syscfg_init failure: If syscfg_init() fails, the error is logged but the function continues and returns the allocated object. This could lead to using a partially initialized object. Consider either calling FreeCosaDmAgent(pMyObject) and returning NULL on failure, or document why it's safe to continue despite this failure.
| CcspTraceError(("%s: syscfg_init error", __FUNCTION__)); | |
| CcspTraceError(("%s: syscfg_init error", __FUNCTION__)); | |
| FreeCosaDmAgent(pMyObject); | |
| return (ANSC_HANDLE)NULL; |
| continue; | ||
| } | ||
| else { | ||
| CcspTraceDebug(("Read eventfd %d bytes\n", nbytes)); |
There was a problem hiding this comment.
Inconsistent indentation: This else block uses spaces for indentation while the rest of the file appears to use proper indentation. The lines should be indented with the same style as the surrounding code.
| CcspTraceDebug(("Read eventfd %d bytes\n", nbytes)); | |
| CcspTraceDebug(("Read eventfd %d bytes\n", nbytes)); |
No description provided.