Skip to content

Commit

Permalink
perf: xgene: Remove bogus IS_ERR() check
Browse files Browse the repository at this point in the history
In acpi_get_pmu_hw_inf we pass the address of a local variable to IS_ERR(),
which doesn't make sense, as the pointer must be a real, valid pointer.
This doesn't cause a functional problem, as IS_ERR() will evaluate as
false, but the check is bogus and causes static checkers to complain.

Remove the bogus check.

The bug is reported by Dan Carpenter <[email protected]> in [1]

[1] https://www.spinics.net/lists/arm-kernel/msg535957.html

Signed-off-by: Tai Nguyen <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
Tai Nguyen authored and wildea01 committed Oct 17, 2016
1 parent baa5567 commit 9a1a1f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/perf/xgene_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ xgene_pmu_dev_ctx *acpi_get_pmu_hw_inf(struct xgene_pmu *xgene_pmu,
rc = acpi_dev_get_resources(adev, &resource_list,
acpi_pmu_dev_add_resource, &res);
acpi_dev_free_resource_list(&resource_list);
if (rc < 0 || IS_ERR(&res)) {
if (rc < 0) {
dev_err(dev, "PMU type %d: No resource address found\n", type);
goto err;
}
Expand Down

0 comments on commit 9a1a1f4

Please sign in to comment.