Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752541AbbKIL6t (ORCPT ); Mon, 9 Nov 2015 06:58:49 -0500 Received: from mail-ig0-f182.google.com ([209.85.213.182]:33782 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752262AbbKIL6q (ORCPT ); Mon, 9 Nov 2015 06:58:46 -0500 Subject: Re: [PATCH 3/4] tty: Abstract and encapsulate tty->closing behavior To: Johannes Stezenbach References: <1447020173-32207-1-git-send-email-peter@hurleysoftware.com> <1447020173-32207-4-git-send-email-peter@hurleysoftware.com> <20151109091214.GD16715@sig21.net> Cc: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, netdev@vger.kernel.org, Karsten Keil , Martin Schwidefsky , Heiko Carstens , Jesper Nilsson , Mikael Starvik , Jiri Kosina , David Sterba , Mark Hounschell From: Peter Hurley Message-ID: <56408A72.4050301@hurleysoftware.com> Date: Mon, 9 Nov 2015 06:58:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151109091214.GD16715@sig21.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 23 On 11/09/2015 04:12 AM, Johannes Stezenbach wrote: > On Sun, Nov 08, 2015 at 05:02:52PM -0500, Peter Hurley wrote: >> +void tty_ldisc_closing(struct tty_struct *tty) >> +{ >> + struct tty_ldisc *ld = tty_ldisc_ref(tty); >> + >> + if (ld->ops->closing) >> + ld->ops->closing(tty); >> + if (ld) >> + tty_ldisc_deref(ld); >> +} > > That looks strange. Do you need to check ld _before_ dereferencing? Yes. Thanks for noticing. Regards, Peter Hurley -- 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/