Re: [PATCH 3/3] i2c: i801: avoid panic if ioreamp fails

2019-05-10 Thread Kefeng Wang
On 2019/5/10 20:18, Jean Delvare wrote: > On Fri, 10 May 2019 17:35:46 +0800, Kefeng Wang wrote: >> On 2019/5/10 16:09, Jean Delvare wrote: >>> We don't need this anyway. The comment says it can't fail, so why >>> bother checking for a condition which will never happen? >> The ioremap could

Re: [PATCH 3/3] i2c: i801: avoid panic if ioreamp fails

2019-05-10 Thread Jean Delvare
On Fri, 10 May 2019 17:35:46 +0800, Kefeng Wang wrote: > On 2019/5/10 16:09, Jean Delvare wrote: > > We don't need this anyway. The comment says it can't fail, so why > > bother checking for a condition which will never happen? > > The ioremap could fails due to no memory, our inner test

Re: [PATCH 3/3] i2c: i801: avoid panic if ioreamp fails

2019-05-10 Thread Kefeng Wang
On 2019/5/10 16:09, Jean Delvare wrote: > Hi Kefeng, > > On Fri, 10 May 2019 11:03:20 +0800, Kefeng Wang wrote: >> If ioremap fails, NULL pointer dereference will happen and >> leading to a kernel panic when access the virtual address >> in check_signature(). >> >> Fix it by check the return

Re: [PATCH 3/3] i2c: i801: avoid panic if ioreamp fails

2019-05-10 Thread Jean Delvare
Hi Kefeng, On Fri, 10 May 2019 11:03:20 +0800, Kefeng Wang wrote: > If ioremap fails, NULL pointer dereference will happen and > leading to a kernel panic when access the virtual address > in check_signature(). > > Fix it by check the return value of ioremap. > > Cc: Jean Delvare > Cc: Wolfram

[PATCH 3/3] i2c: i801: avoid panic if ioreamp fails

2019-05-09 Thread Kefeng Wang
If ioremap fails, NULL pointer dereference will happen and leading to a kernel panic when access the virtual address in check_signature(). Fix it by check the return value of ioremap. Cc: Jean Delvare Cc: Wolfram Sang Cc: linux-...@vger.kernel.org Reported-by: Hulk Robot Signed-off-by: Kefeng