Re: [PATCH] Input: walkera0701 - Fix possible NULL pointer dereference in walkera0701_detach

From: Sudip Mukherjee
Date: Wed Oct 16 2019 - 11:29:21 EST


On Tue, Apr 23, 2019 at 10:56:37PM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@xxxxxxxxxx>
>
> KASAN report this:

<snip>

>
> static void walkera0701_detach(struct parport *port)
> {
> struct walkera_dev *w = &w_dev;
>
> - if (!w->pardevice || w->parport->number != port->number)
> + if (!w->parport)

It doesn't look correct. This way the detach function will never know the
port number to which it is attached, and as a result it will try to do
detach() with all the ports in the system.
Please check the attached patch and maybe (if possible) ask Hulk Robot
to verify if it fixes the problem.

--
Regards
Sudip