Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread YueHaibing
On 2019/5/16 17:51, Mark Brown wrote: > On Thu, May 16, 2019 at 03:56:56PM +0800, YueHaibing wrote: > >> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 >> 04/01/2014 >> Call Trace: >> dump_stack+0xa9/0x10e >> ? __list_del_entry_valid+0x45/0xd0 >> ?

Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread Mark Brown
On Thu, May 16, 2019 at 03:56:56PM +0800, YueHaibing wrote: > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 > 04/01/2014 > Call Trace: > dump_stack+0xa9/0x10e > ? __list_del_entry_valid+0x45/0xd0 > ? __list_del_entry_valid+0x45/0xd0 > __kasan_report+0x171/0x18d

Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread Mukesh Ojha
On 5/16/2019 1:26 PM, YueHaibing wrote: If spi_register_master fails in spi_bitbang_start because device_add failure, We should return the error code other than 0, otherwise calling spi_bitbang_stop may trigger NULL pointer dereference like this: BUG: KASAN: null-ptr-deref in

Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread Axel Lin
YueHaibing 於 2019年5月16日 週四 下午3:57寫道: > > If spi_register_master fails in spi_bitbang_start > because device_add failure, We should return the > error code other than 0, otherwise calling > spi_bitbang_stop may trigger NULL pointer dereference > like this: Reviewed-by: Axel Lin

Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread Geert Uytterhoeven
On Thu, May 16, 2019 at 9:57 AM YueHaibing wrote: > If spi_register_master fails in spi_bitbang_start > because device_add failure, We should return the > error code other than 0, otherwise calling > spi_bitbang_stop may trigger NULL pointer dereference > like this: > > BUG: KASAN: null-ptr-deref

[PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread YueHaibing
If spi_register_master fails in spi_bitbang_start because device_add failure, We should return the error code other than 0, otherwise calling spi_bitbang_stop may trigger NULL pointer dereference like this: BUG: KASAN: null-ptr-deref in __list_del_entry_valid+0x45/0xd0 Read of size 8 at addr