On Thu, May 16, 2019 at 9:57 AM YueHaibing <yuehaib...@huawei.com> 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 __list_del_entry_valid+0x45/0xd0 > Read of size 8 at addr 0000000000000000 by task syz-executor.0/3661
[...] > Reported-by: Hulk Robot <hul...@huawei.com> > Fixes: 702a4879ec33 ("spi: bitbang: Let spi_bitbang_start() take a reference > to master") > Signed-off-by: YueHaibing <yuehaib...@huawei.com> Reviewed-by: Geert Uytterhoeven <geert+rene...@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds