Skip to content

[Coverity CID :190940]Memory - corruptions in /soc/arm/microchip_mec/mec1701/soc.c #13873

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
mandarcthorat1 opened this issue Feb 27, 2019 · 2 comments
Assignees
Labels
area: ARM ARM (32-bit) Architecture 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

@mandarcthorat1
Copy link
Contributor

Static code scan issues seen in File: /soc/arm/microchip_mec/mec1701/soc.c
Category: Memory - corruptions
Function: soc_init
Component: Other
CID: 190940
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@mandarcthorat1 mandarcthorat1 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 Feb 27, 2019
@galak galak added priority: medium Medium impact/importance bug area: ARM ARM (32-bit) Architecture labels Feb 27, 2019
@galak galak self-assigned this Feb 27, 2019
@galak
Copy link
Collaborator

galak commented Feb 27, 2019

Issue related to treating a pointer as an array:

        for (girc_enable_set = (uint32_t *)&INTS_INST->GIRQ08_EN_SET;
             girc_enable_set <= &INTS_INST->GIRQ15_EN_SET;
             girc_enable_set += 5) {
			*girc_enable_set = 0xFFFFFFFF;
		}

If we want we could just remove the loop and do:

		INTS_INST->GIRQ08_EN_SET = 0xFFFFFFFF;
		INTS_INST->GIRQ09_EN_SET = 0xFFFFFFFF;
		INTS_INST->GIRQ10_EN_SET = 0xFFFFFFFF;
		INTS_INST->GIRQ11_EN_SET = 0xFFFFFFFF;
        ...
		INTS_INST->GIRQ15_EN_SET = 0xFFFFFFFF;

But marking this as something we aren't going to change and isn't an issue.

@galak galak closed this as completed Feb 27, 2019
@ceolin
Copy link
Member

ceolin commented Mar 1, 2019

there are other places that coverity is complaining the same thing. I vote classify it as intentional and close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture 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

3 participants