Skip to content

Commit

Permalink
[PATCH] Char: isicom, fix close bug
Browse files Browse the repository at this point in the history
port is dereferenced even if it is NULL.  Dereference it _after_ the
check if (!port)...  Thanks Eric <ef87@yahoo.com> for reporting this.

This fixes

	http://bugzilla.kernel.org/show_bug.cgi?id=7527

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Nov 15, 2006
1 parent f5ad1a7 commit c387fd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/char/isicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,11 +1062,12 @@ static void isicom_shutdown_port(struct isi_port *port)
static void isicom_close(struct tty_struct *tty, struct file *filp)
{
struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
struct isi_board *card;
unsigned long flags;

if (!port)
return;
card = port->card;
if (isicom_paranoia_check(port, tty->name, "isicom_close"))
return;

Expand Down

0 comments on commit c387fd8

Please sign in to comment.