Skip to content

Commit

Permalink
n_hdlc.c: fix check-after-use
Browse files Browse the repository at this point in the history
The Coverity checker spotted that we'd have already oops'ed if "tty"
was NULL.

Since "tty" can't be NULL when we reach this line of code this patch
removes the NULL check.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Oct 17, 2007
1 parent cba4fbb commit 827afdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/n_hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static void n_hdlc_release(struct n_hdlc *n_hdlc)
wake_up_interruptible (&tty->read_wait);
wake_up_interruptible (&tty->write_wait);

if (tty != NULL && tty->disc_data == n_hdlc)
if (tty->disc_data == n_hdlc)
tty->disc_data = NULL; /* Break the tty->n_hdlc link */

/* Release transmit and receive buffers */
Expand Down

0 comments on commit 827afdf

Please sign in to comment.