Skip to content

Commit

Permalink
NET: irda, remove unnecessary checks
Browse files Browse the repository at this point in the history
Stanse found a potential null dereference in ircomm_tty_close
and ircomm_tty_hangup. There is a check for tty being NULL,
but it is dereferenced earlier. But it is bogus, the tty cannot
be NULL, so remove the !tty checks.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Slaby authored and David S. Miller committed Jan 10, 2010
1 parent c3f6c21 commit c026ca5
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions net/irda/ircomm/ircomm_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,6 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)

IRDA_DEBUG(0, "%s()\n", __func__ );

if (!tty)
return;

IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);

Expand Down Expand Up @@ -1007,9 +1004,6 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);

if (!tty)
return;

/* ircomm_tty_flush_buffer(tty); */
ircomm_tty_shutdown(self);

Expand Down

0 comments on commit c026ca5

Please sign in to comment.