Skip to content

[Coverity CID :197537]Control flow issues in /subsys/power/power.c #15166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aasthagr opened this issue Apr 3, 2019 · 4 comments
Closed

[Coverity CID :197537]Control flow issues in /subsys/power/power.c #15166

aasthagr opened this issue Apr 3, 2019 · 4 comments
Assignees
Labels
area: Other bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: medium Medium impact/importance bug

Comments

@aasthagr
Copy link
Collaborator

aasthagr commented Apr 3, 2019

Static code scan issues seen in File: /subsys/power/power.c
Category: Control flow issues
Function: _sys_suspend
Component: Other
CID: 197537
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@aasthagr aasthagr added area: Other bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Apr 3, 2019
@galak galak added the priority: high High impact/importance bug label Apr 3, 2019
@nashif
Copy link
Member

nashif commented Apr 4, 2019

________________________________________________________________________________________________________
*** CID 197537:  Control flow issues  (DEADCODE)
/subsys/power/power.c: 118 in _sys_suspend()
112     		}
113     #endif
114     		/*
115     		 * Disable idle exit notification as it is not needed
116     		 * in deep sleep mode.
117     		 */
>>>     CID 197537:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "_sys_pm_idle_exit_notificat...".
118     		_sys_pm_idle_exit_notification_disable();
119     	}
120     
121     	/* Enter power state */
122     	sys_pm_debug_start_timer();
123     	sys_set_power_state(pm_state);

** CID 197536:  Parse warnings  (PARSE_ERROR)
/include/mgmt/buf.h: 11 in ()

@nashif nashif added priority: medium Medium impact/importance bug and removed priority: high High impact/importance bug labels Apr 4, 2019
@nashif
Copy link
Member

nashif commented Apr 4, 2019

lower prio based on the nature of issue.

@andyross
Copy link
Collaborator

andyross commented Apr 4, 2019

Drive-by analysis: this looks like a false positive. If we don't have any deep sleep states configured, then sys_pm_is_deep_sleep_state() will always return false, thus making the local deep_sleep variable always false, thus preventing this block from executing.

But that's static configuration. I don't see anything wrong with the code as written (beyond the fact that we have outrageously poor coverage of the power management stuff in general and lots of it does indeed seem to have been written speculatively for platforms that don't quite exist yet).

Suggest closing.

@nashif
Copy link
Member

nashif commented Apr 9, 2019

false positive

@nashif nashif closed this as completed Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Other bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants