diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 441a37307921..f386d6bd8e0e 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -134,7 +134,7 @@ static int fprobe_init_rethook(struct fprobe *fp, int num) { int i, size; - if (num < 0) + if (num <= 0) return -EINVAL; if (!fp->exit_handler) { @@ -147,8 +147,8 @@ static int fprobe_init_rethook(struct fprobe *fp, int num) size = fp->nr_maxactive; else size = num * num_possible_cpus() * 2; - if (size < 0) - return -E2BIG; + if (size <= 0) + return -EINVAL; fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler); if (!fp->rethook)