diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 11 | ||||
-rw-r--r-- | lib/devres.c | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 63f04c15e6f5..4448f91b865c 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -134,6 +134,17 @@ config SCHEDSTATS | |||
134 | application, you can say N to avoid the very slight overhead | 134 | application, you can say N to avoid the very slight overhead |
135 | this adds. | 135 | this adds. |
136 | 136 | ||
137 | config TIMER_STATS | ||
138 | bool "Collect kernel timers statistics" | ||
139 | depends on DEBUG_KERNEL && PROC_FS | ||
140 | help | ||
141 | If you say Y here, additional code will be inserted into the | ||
142 | timer routines to collect statistics about kernel timers being | ||
143 | reprogrammed. The statistics can be read from /proc/timer_stats. | ||
144 | The statistics collection is started by writing 1 to /proc/timer_stats, | ||
145 | writing 0 stops it. This feature is useful to collect information | ||
146 | about timer usage patterns in kernel and userspace. | ||
147 | |||
137 | config DEBUG_SLAB | 148 | config DEBUG_SLAB |
138 | bool "Debug slab memory allocations" | 149 | bool "Debug slab memory allocations" |
139 | depends on DEBUG_KERNEL && SLAB | 150 | depends on DEBUG_KERNEL && SLAB |
diff --git a/lib/devres.c b/lib/devres.c index 2a668dd7cac7..eb38849aa717 100644 --- a/lib/devres.c +++ b/lib/devres.c | |||
@@ -274,21 +274,21 @@ int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name) | |||
274 | 274 | ||
275 | rc = pci_request_region(pdev, i, name); | 275 | rc = pci_request_region(pdev, i, name); |
276 | if (rc) | 276 | if (rc) |
277 | goto err_region; | 277 | goto err_inval; |
278 | 278 | ||
279 | rc = -ENOMEM; | 279 | rc = -ENOMEM; |
280 | if (!pcim_iomap(pdev, i, 0)) | 280 | if (!pcim_iomap(pdev, i, 0)) |
281 | goto err_iomap; | 281 | goto err_region; |
282 | } | 282 | } |
283 | 283 | ||
284 | return 0; | 284 | return 0; |
285 | 285 | ||
286 | err_iomap: | ||
287 | pcim_iounmap(pdev, iomap[i]); | ||
288 | err_region: | 286 | err_region: |
289 | pci_release_region(pdev, i); | 287 | pci_release_region(pdev, i); |
290 | err_inval: | 288 | err_inval: |
291 | while (--i >= 0) { | 289 | while (--i >= 0) { |
290 | if (!(mask & (1 << i))) | ||
291 | continue; | ||
292 | pcim_iounmap(pdev, iomap[i]); | 292 | pcim_iounmap(pdev, iomap[i]); |
293 | pci_release_region(pdev, i); | 293 | pci_release_region(pdev, i); |
294 | } | 294 | } |