--- serial_core.c 2004-01-16 14:20:15.000000000 -0600 +++ serial_core.c.new 2004-01-16 14:19:43.000000000 -0600 @@ -2304,7 +2304,7 @@ * then we can't register the port. */ for (i = 0; i < drv->nr; i++) - if (uart_match_port(drv->state[i].port, port)) + if (drv->state[i].port && uart_match_port(drv->state[i].port, port)) return &drv->state[i]; /* @@ -2313,7 +2313,8 @@ * used (indicated by zero iobase). */ for (i = 0; i < drv->nr; i++) - if (drv->state[i].port->type == PORT_UNKNOWN && + if (drv->state[i].port && + drv->state[i].port->type == PORT_UNKNOWN && drv->state[i].port->iobase == 0 && drv->state[i].count == 0) return &drv->state[i]; @@ -2323,7 +2324,8 @@ * entry which doesn't have a real port associated with it. */ for (i = 0; i < drv->nr; i++) - if (drv->state[i].port->type == PORT_UNKNOWN && + if (drv->state[i].port && + drv->state[i].port->type == PORT_UNKNOWN && drv->state[i].count == 0) return &drv->state[i];