Skip to content

Commit dd04b45

Browse files
jdelvaretorvalds
authored andcommitted
idr: print a stack dump after ida_remove warning
We print a dump stack after idr_remove warning. This is useful to find the faulty piece of code. Let's do the same for ida_remove, as it would be equally useful there. [akpm@linux-foundation.org: convert the open-coded printk+dump_stack into WARN()] Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Tejun Heo <tj@kernel.org> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8bdc237 commit dd04b45

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/idr.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,7 @@ EXPORT_SYMBOL(idr_alloc_cyclic);
524524

525525
static void idr_remove_warning(int id)
526526
{
527-
printk(KERN_WARNING
528-
"idr_remove called for id=%d which is not allocated.\n", id);
529-
dump_stack();
527+
WARN(1, "idr_remove called for id=%d which is not allocated.\n", id);
530528
}
531529

532530
static void sub_remove(struct idr *idp, int shift, int id)
@@ -1064,8 +1062,7 @@ void ida_remove(struct ida *ida, int id)
10641062
return;
10651063

10661064
err:
1067-
printk(KERN_WARNING
1068-
"ida_remove called for id=%d which is not allocated.\n", id);
1065+
WARN(1, "ida_remove called for id=%d which is not allocated.\n", id);
10691066
}
10701067
EXPORT_SYMBOL(ida_remove);
10711068

0 commit comments

Comments
 (0)