Re: [PATCH] 8250: Fix oops from setserial

From: Andrew Morton
Date: Fri May 29 2009 - 23:54:47 EST


On Thu, 28 May 2009 14:01:35 +0100 Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:

> From: Alan Cox <alan@xxxxxxxxxxxxxxx>
>
> [Impact: ok I just put this here to wind up Linus]
>
> If you setserial a port which has never been initialised we change the type
> but don't update the I/O method pointers. The same problem is true if you
> change the io type of a port - but nobody ever does that so nobody noticed!
>
> Remember the old type and when attaching if the type has changed reload the
> port accessor pointers. We can't do it blindly as some 8250 drivers load custom
> accessors and we must not stomp those.
>
> Closes-bug: #13367

Please quote the full bug URL.

a) for consistency

b) because there are multiple bug tracking systems out there:

y:/usr/src/git26> git-log|grep bugzilla.redhat|wc -l
123

> static void set_io_from_upio(struct uart_port *p)
> {
> + struct uart_8250_port *up = (struct uart_8250_port *)p;

container_of() is nicer, IMO. It's clearer, and doesn't require that
the uart_port be the fist member.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/