Message ID | 20200822165433.58228-1-zhongguohua1@huawei.com |
---|---|
State | New |
Headers | show |
Series | Re:Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero | expand |
diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h index a3b98c86f077..161c656ee3ee 100644 --- a/include/asm-generic/div64.h +++ b/include/asm-generic/div64.h @@ -43,6 +43,11 @@ # define do_div(n,base) ({ \ uint32_t __base = (base); \ uint32_t __rem; \ + if (unlikely(base == 0)) { \ + pr_err("do_div base=%d\n",base); \ + dump_stack(); \ + force_sig(SIGFPE); \ + } Then it also needto add this checking in functions of