summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/ioc3_serial.c
diff options
context:
space:
mode:
authorWei Yongjun2012-09-07 08:53:49 +0200
committerGreg Kroah-Hartman2012-09-11 01:33:02 +0200
commit3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad (patch)
tree2da51f22ede1fdf28768f40b16e31b85d8697268 /drivers/tty/serial/ioc3_serial.c
parentserial: omap: Request pins using pinctrl framework (diff)
downloadkernel-qcow2-linux-3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad.tar.gz
kernel-qcow2-linux-3d39aa6869c3cfc72dccb6c9431ecdb3ad7627ad.tar.xz
kernel-qcow2-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/ioc3_serial.c')
-rw-r--r--drivers/tty/serial/ioc3_serial.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c
index 758ff310f7f8..5ac52898a0bb 100644
--- a/drivers/tty/serial/ioc3_serial.c
+++ b/drivers/tty/serial/ioc3_serial.c
@@ -1120,13 +1120,14 @@ static inline int do_read(struct uart_port *the_port, char *buf, int len)
struct ioc3_port *port = get_ioc3_port(the_port);
struct ring *inring;
struct ring_entry *entry;
- struct port_hooks *hooks = port->ip_hooks;
+ struct port_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 IOC3. When the rx_timer
* expires or the rx_high condition arises, we take an interrupt.