projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
baf9cc8
)
ARC: perf: avoid kernel killing where it is possible
author
Eugeniy Paltsev
<
[email protected]
>
Thu, 13 Dec 2018 16:56:21 +0000
(19:56 +0300)
committer
Vineet Gupta
<
[email protected]
>
Thu, 17 Jan 2019 22:38:00 +0000
(14:38 -0800)
No, not gonna die tonight.
Signed-off-by: Eugeniy Paltsev <
[email protected]
>
Signed-off-by: Vineet Gupta <
[email protected]
>
arch/arc/kernel/perf_event.c
patch
|
blob
|
history
diff --git
a/arch/arc/kernel/perf_event.c
b/arch/arc/kernel/perf_event.c
index 248c7b61690a913954aa8fda64f39f58ee7dd74c..861a8aea51f9fe0c086665dd84677f7ee80ea838 100644
(file)
--- a/
arch/arc/kernel/perf_event.c
+++ b/
arch/arc/kernel/perf_event.c
@@
-580,10
+580,12
@@
static int arc_pmu_device_probe(struct platform_device *pdev)
return -ENODEV;
}
BUILD_BUG_ON(ARC_PERF_MAX_COUNTERS > 32);
- BUG_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS);
+ if (WARN_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS))
+ return -EINVAL;
READ_BCR(ARC_REG_CC_BUILD, cc_bcr);
- BUG_ON(!cc_bcr.v); /* Counters exist but No countable conditions ? */
+ if (WARN(!cc_bcr.v, "Counters exist but No countable conditions?"))
+ return -EINVAL;
arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), GFP_KERNEL);
if (!arc_pmu)