Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758678AbYGVX0A (ORCPT ); Tue, 22 Jul 2008 19:26:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756946AbYGVXTb (ORCPT ); Tue, 22 Jul 2008 19:19:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:57738 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756918AbYGVXT3 (ORCPT ); Tue, 22 Jul 2008 19:19:29 -0400 Date: Tue, 22 Jul 2008 16:16:14 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org, jejb@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Guennadi Liakhovetski Subject: [patch 23/47] serial: fix serial_match_port() for dynamic major tty-device numbers Message-ID: <20080722231614.GX8282@suse.de> References: <20080722230208.148102983@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="serial-fix-serial_match_port-for-dynamic-major-tty-device-numbers.patch" In-Reply-To: <20080722231342.GA8282@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1683 Lines: 46 2.6.25-stable review patch. If anyone has any objections, please let us know. ------------------ From: Guennadi Liakhovetski commit 7ca796f492a11f9408e661c8f22cd8c4f486b8e5 upstream As reported by Vipul Gandhi, the current serial_match_port() doesn't work for tty-devices using dynamic major number allocation. Fix it. It oopses if you suspend a serial port with _dynamic_ major number. ATM, I think, there's only the drivers/serial/jsm/jsm_driver.c driver, that does it in-tree. Signed-off-by: Guennadi Liakhovetski Tested-by: Vipul Gandhi Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/serial/serial_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1950,7 +1950,9 @@ struct uart_match { static int serial_match_port(struct device *dev, void *data) { struct uart_match *match = data; - dev_t devt = MKDEV(match->driver->major, match->driver->minor) + match->port->line; + struct tty_driver *tty_drv = match->driver->tty_driver; + dev_t devt = MKDEV(tty_drv->major, tty_drv->minor_start) + + match->port->line; return dev->devt == devt; /* Actually, only one tty per port */ } -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/