serial: serial_core: Perform NULL checks for release/request_port ops
Doing the following UART bind/unbind sequence on a i.mx platform causes a kernel crash due to NULL pointer dereference: echo 21f4000.serial > /sys/bus/platform/drivers/imx-uart/bind echo 21f4000.serial > /sys/bus/platform/drivers/imx-uart/unbind Fix this problem by adding NULL checks prior to calling release/request_port ops. Reported-by: NFugang Duan <fugang.duan@nxp.com> Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Tested-by: NFugang Duan <fugang.duan@nxp.com> Acked-by: NFugang Duan <fugang.duan@nxp.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
想要评论请 注册 或 登录