Re: [PATCH] tty: fix NULL pointer issue when tty_port ops is not set

2019-03-22 Thread Fabien DESSENNE
Hi Greg, I do not think that any driver faces this problem. Nevertheless I found 2 drivers declaring an 'empty' struct (wasted) to solve this issue: drivers/char/ttyprintk: static const struct tty_port_operations null_ops = { }; drivers/tty/vcc.c: static struct tty_port_operations vcc_port_ops

Re: [PATCH] tty: fix NULL pointer issue when tty_port ops is not set

2019-03-21 Thread Greg Kroah-Hartman
On Thu, Mar 21, 2019 at 04:43:26PM +0100, Fabien Dessenne wrote: > Unlike 'client_ops' which is initialized to 'default_client_ops', the > port operations 'ops' may be left to NULL. > Check the 'ops' value before checking the 'ops->x' value. > > Signed-off-by: Fabien Dessenne > --- > drivers/tty

[PATCH] tty: fix NULL pointer issue when tty_port ops is not set

2019-03-21 Thread Fabien Dessenne
Unlike 'client_ops' which is initialized to 'default_client_ops', the port operations 'ops' may be left to NULL. Check the 'ops' value before checking the 'ops->x' value. Signed-off-by: Fabien Dessenne --- drivers/tty/tty_port.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) d