Commit 674d5a34 authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by Linus Torvalds

IrDA update 2/4:

o [CORRECT] Fix two bugs found by the Stanford checker in IrCOMM
parent e6499e49
...@@ -514,7 +514,7 @@ int ircomm_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -514,7 +514,7 @@ int ircomm_proc_read(char *buf, char **start, off_t offset, int len)
self = (struct ircomm_cb *) hashbin_get_first(ircomm); self = (struct ircomm_cb *) hashbin_get_first(ircomm);
while (self != NULL) { while (self != NULL) {
ASSERT(self->magic == IRCOMM_MAGIC, return len;); ASSERT(self->magic == IRCOMM_MAGIC, break;);
if(self->line < 0x10) if(self->line < 0x10)
len += sprintf(buf+len, "ircomm%d", self->line); len += sprintf(buf+len, "ircomm%d", self->line);
......
...@@ -525,6 +525,9 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -525,6 +525,9 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
if (!tty) if (!tty)
return; return;
ASSERT(self != NULL, return;);
ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
save_flags(flags); save_flags(flags);
cli(); cli();
...@@ -536,9 +539,6 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -536,9 +539,6 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
return; return;
} }
ASSERT(self != NULL, return;);
ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
if ((tty->count == 1) && (self->open_count != 1)) { if ((tty->count == 1) && (self->open_count != 1)) {
/* /*
* Uh, oh. tty->count is 1, which means that the tty * Uh, oh. tty->count is 1, which means that the tty
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment