Skip to content
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

[Coverity CID: 182597] Control flow issues in /drivers/sensor/vl53l0x/vl53l0x.c #5887

Closed
Shilpashree3lc-zz opened this issue Jan 30, 2018 · 2 comments
Assignees
Labels
area: Drivers 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

@Shilpashree3lc-zz
Copy link
Contributor

Static code scan issues seen in File: /drivers/sensor/vl53l0x/vl53l0x.c
Category: Control flow issues
Function: vl53l0x_init
Component: Drivers
CID: 182597
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@Shilpashree3lc-zz Shilpashree3lc-zz added area: Drivers bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Jan 30, 2018
@nashif nashif added the priority: medium Medium impact/importance bug label Feb 6, 2018
@Shilpashree3lc-zz
Copy link
Contributor Author

Shilpashree3lc-zz commented Mar 6, 2018

*** CID 182597:  Control flow issues  (NO_EFFECT)
/drivers/sensor/vl53l0x/vl53l0x.c: 272 in vl53l0x_init()
266     	if (ret < 0) {
267     		SYS_LOG_ERR("VL53L0X_DataInit return error (%d)", ret);
268     		return -ENOTSUP;
269     	}
270     
271     	ret = vl53l0x_setup_single_shot(dev);
>>>     CID 182597:  Control flow issues  (NO_EFFECT)
>>>     This less-than-zero comparison of an unsigned value is never true. "ret < 0".

272     	if (ret < 0) {
273     		return -ENOTSUP;
274     	}
275     
276     	dev->driver_api = &vl53l0x_api_funcs;
277     	return 0;

@galak
Copy link
Collaborator

galak commented Mar 6, 2018

Fixed by #6250

@galak galak closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Drivers 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

4 participants