Skip to content

Commit

Permalink
idr: print a stack dump after ida_remove warning
Browse files Browse the repository at this point in the history
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.

[[email protected]: convert the open-coded printk+dump_stack into WARN()]
Signed-off-by: Jean Delvare <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Takashi Iwai <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jdelvare authored and torvalds committed Jul 3, 2013
1 parent 8bdc237 commit dd04b45
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,7 @@ EXPORT_SYMBOL(idr_alloc_cyclic);

static void idr_remove_warning(int id)
{
printk(KERN_WARNING
"idr_remove called for id=%d which is not allocated.\n", id);
dump_stack();
WARN(1, "idr_remove called for id=%d which is not allocated.\n", id);
}

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

err:
printk(KERN_WARNING
"ida_remove called for id=%d which is not allocated.\n", id);
WARN(1, "ida_remove called for id=%d which is not allocated.\n", id);
}
EXPORT_SYMBOL(ida_remove);

Expand Down

0 comments on commit dd04b45

Please sign in to comment.