diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-09-07 14:53:49 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-10 16:33:02 -0700 |
commit | 3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad (patch) | |
tree | 2da51f22ede1fdf28768f40b16e31b85d8697268 /drivers/tty/serial/ioc4_serial.c | |
parent | 3dbc5ce2bffa40ef9a95247f3e9ea0f8874489ac (diff) | |
download | linux-3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad.tar.gz linux-3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad.tar.bz2 linux-3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad.zip |
TTY: serial: move the dereference below the NULL test
The dereference should be moved below the NULL test.
spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/ioc4_serial.c')
-rw-r--r-- | drivers/tty/serial/ioc4_serial.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index cc5aca78ad9b..3e7da10cebba 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c @@ -2069,13 +2069,14 @@ static inline int do_read(struct uart_port *the_port, unsigned char *buf, struct ioc4_port *port = get_ioc4_port(the_port, 0); struct ring *inring; struct ring_entry *entry; - struct hooks *hooks = port->ip_hooks; + struct hooks *hooks; int byte_num; char *sc; int loop_counter; BUG_ON(!(len >= 0)); BUG_ON(!port); + hooks = port->ip_hooks; /* There is a nasty timing issue in the IOC4. When the rx_timer * expires or the rx_high condition arises, we take an interrupt. |