RE: [PATCH] serial: imx: Avoid NULL pointer dereference in bind/unbind uart device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> Sent: Friday, May 20, 2016 11:47 AM
> To: Fugang Duan <fugang.duan@xxxxxxx>
> Cc: linux-serial@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] serial: imx: Avoid NULL pointer dereference in
> bind/unbind uart device
> 
> On Fri, May 20, 2016 at 10:57:16AM +0800, Andy Duan wrote:
> > Did bind/unbind uart5 device on i.MX6SX platform like below command,
> > there have NULL pointer dereference cause kernel oops.
> > 	echo  21f4000.serial > /sys/bus/platform/drivers/imx-uart/bind
> > 	echo  21f4000.serial > /sys/bus/platform/drivers/imx-uart/unbind
> >
> > The driver does not define .release_port/.request_port for uart_ops,
> > and
> > uart_remove_one_port() doesn't check if this op is NULL before calling
> > it, so add these interfaces to support bind/unbind operation.
> 
> Why not fix the root of the problem, and have uart_remove_one_port check
> before calling?  That way you fix all of the drivers, not just this one?
> 
> thanks,
> 
> greg k-h

Good suggestion, I will submit V2. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux