Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754706Ab1B1POT (ORCPT ); Mon, 28 Feb 2011 10:14:19 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:37720 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754527Ab1B1POS (ORCPT ); Mon, 28 Feb 2011 10:14:18 -0500 Date: Mon, 28 Feb 2011 10:14:16 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Jiri Slaby cc: gregkh@suse.de, , , , Alan Cox Subject: Re: [PATCH 1/2] USB: serial/keyspan_pda, fix potential tty NULL dereferences In-Reply-To: <1298885646-9293-1-git-send-email-jslaby@suse.cz> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1072 Lines: 27 On Mon, 28 Feb 2011, Jiri Slaby wrote: > Make sure that we check the return value of tty_port_tty_get. > Sometimes it may return NULL and we later dereference that. > > There are several places to check. For easier handling, > tty_port_tty_get is moved directly to the palce where needed in > keyspan_pda_rx_interrupt. > > Signed-off-by: Jiri Slaby > Cc: Alan Cox > Cc: Greg Kroah-Hartman I wonder about these changes. Does it makes sense to add this checking everywhere? A more reasonable approach might be to make sure that tty_port_tty_get is never called in a context where it could return NULL. Or would that involve just as much effort, making work routines and so on check to see whether there's an open TTY device before doing anything else? Alan Stern -- 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/