| Message ID | 20251024054830.933910-10-tduszynski@marvell.com (mailing list archive) |
|---|---|
| State | Changes Requested |
| Delegated to: | David Marchand |
| Headers | |
| Series | lib/pmu: cleanups and trace integration | |
Checks
| Context | Check | Description |
|---|---|---|
| ci/checkpatch | success | coding style OK |
| ci/loongarch-compilation | success | Compilation OK |
| ci/loongarch-unit-testing | success | Unit Testing PASS |
| ci/Intel-compilation | success | Compilation OK |
| ci/iol-mellanox-Functional | success | Functional Testing PASS |
| ci/iol-marvell-Functional | success | Functional Testing PASS |
| ci/iol-mellanox-Performance | success | Performance Testing PASS |
| ci/iol-intel-Performance | success | Performance Testing PASS |
| ci/iol-unit-arm64-testing | pending | Testing pending |
| ci/intel-Testing | success | Testing PASS |
| ci/intel-Functional | success | Functional PASS |
| ci/iol-sample-apps-testing | warning | Testing issues |
| ci/github-robot: build | success | github build: passed |
| ci/github-robot-post | success | github post: success |
| ci/iol-unit-amd64-testing | success | Testing PASS |
| ci/iol-intel-Functional | success | Functional Testing PASS |
| ci/iol-broadcom-Performance | success | Performance Testing PASS |
| ci/aws-unit-testing | success | Unit Testing PASS |
| ci/iol-compile-amd64-testing | warning | Testing issues |
| ci/iol-compile-arm64-testing | success | Testing PASS |
Commit Message
diff --git a/lib/pmu/pmu.c b/lib/pmu/pmu.c index 4bce48c359..c14128addd 100644 --- a/lib/pmu/pmu.c +++ b/lib/pmu/pmu.c @@ -126,7 +126,7 @@ get_event_config(const char *name, uint64_t config[3]) if (fp == NULL) return -errno; - ret = fread(buf, 1, sizeof(buf), fp); + ret = fread(buf, 1, sizeof(buf) - 1, fp); if (ret == 0) { fclose(fp); diff --git a/lib/pmu/pmu_arm64.c b/lib/pmu/pmu_arm64.c index 2c40b5f702..f3a817b42f 100644 --- a/lib/pmu/pmu_arm64.c +++ b/lib/pmu/pmu_arm64.c @@ -24,12 +24,13 @@ read_attr_int(const char *path, int *val) if (fd == -1) return -errno; - ret = read(fd, buf, sizeof(buf)); + ret = read(fd, buf, sizeof(buf) - 1); if (ret == -1) { close(fd); return -errno; } + buf[ret] = '\0'; *val = strtol(buf, NULL, 10); close(fd);