diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-01-10 06:30:16 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:43:16 -0500 |
commit | ca1cce49c2778439d00bbf516f70386f3d3b71e5 (patch) | |
tree | 637225c572d045b9273c8239d211326d314f5019 | |
parent | e6c4ef984ebbd1a0458503417da91f3de47cbbe0 (diff) |
Char: synclink, remove unnecessary checks
Stanse found a potential null dereference in mgsl_put_char and
mgsl_write. There is a check for tty being NULL, but it is
dereferenced earlier.
Actually, tty cannot be NULL in .write and .put_char, so remove
the tests.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/char/synclink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 4846b73ef28d..0658fc548222 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -2031,7 +2031,7 @@ static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) | |||
2031 | if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) | 2031 | if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) |
2032 | return 0; | 2032 | return 0; |
2033 | 2033 | ||
2034 | if (!tty || !info->xmit_buf) | 2034 | if (!info->xmit_buf) |
2035 | return 0; | 2035 | return 0; |
2036 | 2036 | ||
2037 | spin_lock_irqsave(&info->irq_spinlock, flags); | 2037 | spin_lock_irqsave(&info->irq_spinlock, flags); |
@@ -2121,7 +2121,7 @@ static int mgsl_write(struct tty_struct * tty, | |||
2121 | if (mgsl_paranoia_check(info, tty->name, "mgsl_write")) | 2121 | if (mgsl_paranoia_check(info, tty->name, "mgsl_write")) |
2122 | goto cleanup; | 2122 | goto cleanup; |
2123 | 2123 | ||
2124 | if (!tty || !info->xmit_buf) | 2124 | if (!info->xmit_buf) |
2125 | goto cleanup; | 2125 | goto cleanup; |
2126 | 2126 | ||
2127 | if ( info->params.mode == MGSL_MODE_HDLC || | 2127 | if ( info->params.mode == MGSL_MODE_HDLC || |