|
@@ -276,7 +276,7 @@ static void kmemleak_disable(void);
|
|
* Print a warning and dump the stack trace.
|
|
* Print a warning and dump the stack trace.
|
|
*/
|
|
*/
|
|
#define kmemleak_warn(x...) do { \
|
|
#define kmemleak_warn(x...) do { \
|
|
- pr_warning(x); \
|
|
|
|
|
|
+ pr_warn(x); \
|
|
dump_stack(); \
|
|
dump_stack(); \
|
|
kmemleak_warning = 1; \
|
|
kmemleak_warning = 1; \
|
|
} while (0)
|
|
} while (0)
|
|
@@ -543,7 +543,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
|
|
|
|
|
|
object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
|
|
object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
|
|
if (!object) {
|
|
if (!object) {
|
|
- pr_warning("Cannot allocate a kmemleak_object structure\n");
|
|
|
|
|
|
+ pr_warn("Cannot allocate a kmemleak_object structure\n");
|
|
kmemleak_disable();
|
|
kmemleak_disable();
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
@@ -764,7 +764,7 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp)
|
|
|
|
|
|
area = kmem_cache_alloc(scan_area_cache, gfp_kmemleak_mask(gfp));
|
|
area = kmem_cache_alloc(scan_area_cache, gfp_kmemleak_mask(gfp));
|
|
if (!area) {
|
|
if (!area) {
|
|
- pr_warning("Cannot allocate a scan area\n");
|
|
|
|
|
|
+ pr_warn("Cannot allocate a scan area\n");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1515,7 +1515,7 @@ static void start_scan_thread(void)
|
|
return;
|
|
return;
|
|
scan_thread = kthread_run(kmemleak_scan_thread, NULL, "kmemleak");
|
|
scan_thread = kthread_run(kmemleak_scan_thread, NULL, "kmemleak");
|
|
if (IS_ERR(scan_thread)) {
|
|
if (IS_ERR(scan_thread)) {
|
|
- pr_warning("Failed to create the scan thread\n");
|
|
|
|
|
|
+ pr_warn("Failed to create the scan thread\n");
|
|
scan_thread = NULL;
|
|
scan_thread = NULL;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1874,8 +1874,8 @@ void __init kmemleak_init(void)
|
|
scan_area_cache = KMEM_CACHE(kmemleak_scan_area, SLAB_NOLEAKTRACE);
|
|
scan_area_cache = KMEM_CACHE(kmemleak_scan_area, SLAB_NOLEAKTRACE);
|
|
|
|
|
|
if (crt_early_log > ARRAY_SIZE(early_log))
|
|
if (crt_early_log > ARRAY_SIZE(early_log))
|
|
- pr_warning("Early log buffer exceeded (%d), please increase "
|
|
|
|
- "DEBUG_KMEMLEAK_EARLY_LOG_SIZE\n", crt_early_log);
|
|
|
|
|
|
+ pr_warn("Early log buffer exceeded (%d), please increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE\n",
|
|
|
|
+ crt_early_log);
|
|
|
|
|
|
/* the kernel is still in UP mode, so disabling the IRQs is enough */
|
|
/* the kernel is still in UP mode, so disabling the IRQs is enough */
|
|
local_irq_save(flags);
|
|
local_irq_save(flags);
|
|
@@ -1960,7 +1960,7 @@ static int __init kmemleak_late_init(void)
|
|
dentry = debugfs_create_file("kmemleak", S_IRUGO, NULL, NULL,
|
|
dentry = debugfs_create_file("kmemleak", S_IRUGO, NULL, NULL,
|
|
&kmemleak_fops);
|
|
&kmemleak_fops);
|
|
if (!dentry)
|
|
if (!dentry)
|
|
- pr_warning("Failed to create the debugfs kmemleak file\n");
|
|
|
|
|
|
+ pr_warn("Failed to create the debugfs kmemleak file\n");
|
|
mutex_lock(&scan_mutex);
|
|
mutex_lock(&scan_mutex);
|
|
start_scan_thread();
|
|
start_scan_thread();
|
|
mutex_unlock(&scan_mutex);
|
|
mutex_unlock(&scan_mutex);
|