Skip to content

Commit

Permalink
Merge pull request rdkcentral#4789 from hgfell683/main_coverity
Browse files Browse the repository at this point in the history
DELIA-62688 - [Coverity] New issues identified in devicesettings
  • Loading branch information
apatel859 authored and hgfell683 committed Jan 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2e48b7c commit dce4ea8
Showing 7 changed files with 21 additions and 8 deletions.
4 changes: 4 additions & 0 deletions DisplayInfo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -15,6 +15,10 @@ All notable changes to this RDK Service will be documented in this file.
* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
## [1.0.5] - 2024-04-01
### Security
- Corrected Coverity security within the plugin.

## [1.0.4] - 2023-09-12
### Added
- Implement Thunder Plugin Configuration for Kirkstone builds(CMake-3.20 & above)
6 changes: 4 additions & 2 deletions DisplayInfo/DeviceSettings/Amlogic/SoC_abstraction.cpp
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ static void getGraphicSize(uint32_t &w, uint32_t &h)

/* Setup KMS */
kms = kms_setup(drm_fd);
if( !kms->crtc ) {
if(!kms || !kms->crtc ) {
cout << "[Amlogic] kms_setup fail" << endl;
break;
}
@@ -153,7 +153,9 @@ static void getGraphicSize(uint32_t &w, uint32_t &h)

cout << "[getGraphicSize] width : " << w << endl;
cout << "[getGraphicSize] height : " << h << endl;
close(drm_fd);
if(drm_fd >= 0){
close(drm_fd);
}
}


6 changes: 5 additions & 1 deletion DisplayInfo/DeviceSettings/Amlogic/kms.c
Original file line number Diff line number Diff line change
@@ -29,7 +29,11 @@ void kms_setup_encoder( int fd, kms_ctx *kms )

kms->encoder = drmModeGetEncoder(fd,kms->res->encoders[i]);

if ( kms->encoder && ( kms->encoder->encoder_id == kms->connector->encoder_id ) ) {
if(!kms->encoder){
return;
}

if ( kms->encoder->encoder_id == kms->connector->encoder_id ) {

kms->encoder_id = kms->encoder->encoder_id;
return;
4 changes: 2 additions & 2 deletions DisplayInfo/DeviceSettings/PlatformImplementation.cpp
Original file line number Diff line number Diff line change
@@ -230,7 +230,7 @@ class DisplayInfoImplementation :
TRACE(Trace::Information, (_T("EDID Verification failed")));
ret = Core::ERROR_GENERAL;
}
delete edidbytes;
delete[] edidbytes;
}
else
{
@@ -605,7 +605,7 @@ class DisplayInfoImplementation :
TRACE(Trace::Error, (_T("EDID Verification failed")));
ret = Core::ERROR_GENERAL;
}
delete edidbytes;
delete[] edidbytes;
}
else
{
2 changes: 1 addition & 1 deletion DisplayInfo/DeviceSettings/Realtek/SoC_abstraction.cpp
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ static void getGraphicSize(uint32_t &w, uint32_t &h)

/* Setup KMS */
kms = kms_setup(drm_fd);
if( !kms->crtc ) {
if(!kms || !kms->crtc ) {
cout << "[Realtek] kms_setup fail" << endl;
break;
}
5 changes: 4 additions & 1 deletion DisplayInfo/DeviceSettings/Realtek/kms.c
Original file line number Diff line number Diff line change
@@ -30,8 +30,11 @@ void kms_setup_encoder( int fd, kms_ctx *kms )
for( int i = 0; i < kms->res->count_encoders; i++ ) {

kms->encoder = drmModeGetEncoder(fd,kms->res->encoders[i]);
if(!kms->encoder){
return;
}

if ( kms->encoder && ( kms->encoder->encoder_id == kms->connector->encoder_id ) ) {
if ( kms->encoder->encoder_id == kms->connector->encoder_id ) {

kms->encoder_id = kms->encoder->encoder_id;
return;
2 changes: 1 addition & 1 deletion DisplayInfo/DisplayInfo.cpp
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 3
#define API_VERSION_NUMBER_PATCH 5

namespace WPEFramework {
namespace {

0 comments on commit dce4ea8

Please sign in to comment.