When the arguments passed by the caller are invalid, WARN_ON_ONCE()
is proper than BUG_ON() which may crash the kernel.
Signed-off-by: Lai Jiangshan
---
lib/idr.c |9 +
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 104f87f..e4f9965 100644
On Fri, Apr 18, 2014 at 08:49:52PM +0800, Lai Jiangshan wrote:
> @@ -1135,7 +1136,7 @@ void ida_simple_remove(struct ida *ida, unsigned int id)
> {
> unsigned long flags;
>
> - BUG_ON((int)id < 0);
> + WARN_ON_ONCE((int)id < 0);
Shouldn't this be moved to ida_remove()? Also, it p
2 matches
Mail list logo