Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752786AbbKIJwm (ORCPT ); Mon, 9 Nov 2015 04:52:42 -0500 Received: from mail.sig21.net ([80.244.240.74]:53432 "EHLO mail.sig21.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751549AbbKIJwi (ORCPT ); Mon, 9 Nov 2015 04:52:38 -0500 X-Greylist: delayed 2414 seconds by postgrey-1.27 at vger.kernel.org; Mon, 09 Nov 2015 04:52:37 EST Date: Mon, 9 Nov 2015 10:12:14 +0100 From: Johannes Stezenbach To: Peter Hurley 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 Subject: Re: [PATCH 3/4] tty: Abstract and encapsulate tty->closing behavior Message-ID: <20151109091214.GD16715@sig21.net> References: <1447020173-32207-1-git-send-email-peter@hurleysoftware.com> <1447020173-32207-4-git-send-email-peter@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447020173-32207-4-git-send-email-peter@hurleysoftware.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-21-Score: -2.9 (--) X-Spam-21-Report: No, score=-2.9 required=8.0 tests=ALL_TRUSTED=-1,BAYES_00=-1.9 autolearn=ham Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 590 Lines: 19 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? Johannes -- 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/