Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Coverity fixes #29

Merged
merged 9 commits into from
Sep 29, 2017
Merged

Coverity fixes #29

merged 9 commits into from
Sep 29, 2017

Conversation

ldorau
Copy link
Member

@ldorau ldorau commented Sep 26, 2017

Fix issues detected by Coverity


This change is Reviewable

@krzycz
Copy link
Contributor

krzycz commented Sep 26, 2017

Reviewed 6 of 7 files at r1.
Review status: 6 of 7 files reviewed at latest revision, 1 unresolved discussion.


src/bpf_ctx.c, line 367 at r1 (raw file):

	}

	enum perf_reader_type_t perf_reader_type =

What's the problem here?


Comments from Reviewable

@krzycz
Copy link
Contributor

krzycz commented Sep 26, 2017

Reviewed 1 of 7 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@ldorau
Copy link
Member Author

ldorau commented Sep 26, 2017

Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/bpf_ctx.c, line 367 at r1 (raw file):

Previously, krzycz (Krzysztof Czurylo) wrote…

What's the problem here?

The type of the last argument of append_item_to_pr_arr() (below) is enum perf_reader_type_t and not enum bpf_prog_type


Comments from Reviewable

@krzycz
Copy link
Contributor

krzycz commented Sep 26, 2017

Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/bpf_ctx.c, line 367 at r1 (raw file):

Previously, ldorau (Lukasz Dorau) wrote…

The type of the last argument of append_item_to_pr_arr() (below) is enum perf_reader_type_t and not enum bpf_prog_type

So, it looks like there is some problem with the design. Do we have two enums, where one is a subset of the another one?


Comments from Reviewable

@ldorau
Copy link
Member Author

ldorau commented Sep 26, 2017

Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/bpf_ctx.c, line 367 at r1 (raw file):

Previously, krzycz (Krzysztof Czurylo) wrote…

So, it looks like there is some problem with the design. Do we have two enums, where one is a subset of the another one?

Yes


Comments from Reviewable

@ldorau
Copy link
Member Author

ldorau commented Sep 28, 2017

Review status: 6 of 8 files reviewed at latest revision, 1 unresolved discussion.


src/bpf_ctx.c, line 367 at r1 (raw file):

Previously, ldorau (Lukasz Dorau) wrote…

Yes

Fixed


Comments from Reviewable

@ldorau
Copy link
Member Author

ldorau commented Sep 28, 2017

Review status: 6 of 8 files reviewed at latest revision, 1 unresolved discussion.


src/bpf_ctx.c, line 367 at r1 (raw file):

Previously, ldorau (Lukasz Dorau) wrote…

Fixed

@krzycz I fixed it, please review the last changes


Comments from Reviewable

@krzycz
Copy link
Contributor

krzycz commented Sep 28, 2017

:lgtm:


Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@ldorau
Copy link
Member Author

ldorau commented Sep 28, 2017

It is better to merge it before PR #26.

@ldorau ldorau mentioned this pull request Sep 28, 2017
@@ -106,7 +110,7 @@ main(int argc, char *argv[])
}

iters_qty = atol(argv[1]);
if (iters_qty == 0) {
if (iters_qty <= 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iters_qty is unsigned

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

s();
fstat(fd, &buf);
(void) fstat(fd, &buf);
s();
close(fd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you exclude close?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is not considered as an issue by Coverity. How often do you check the return value of close()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@krzycz
Copy link
Contributor

krzycz commented Sep 29, 2017

Reviewed 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@marcinslusarz
Copy link
Contributor

:lgtm:


Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@sarahjelinek sarahjelinek merged commit 1eca434 into pmem:master Sep 29, 2017
@ldorau ldorau deleted the coverity-fixes branch September 29, 2017 14:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants