From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail177-1.suw61.mandrillapp.com ([198.2.177.1]:8146 "EHLO mail177-1.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbcCARP7 (ORCPT ); Tue, 1 Mar 2016 12:15:59 -0500 Received: from pmta06.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail177-1.suw61.mandrillapp.com id hqn74s22rtkh for ; Tue, 1 Mar 2016 17:15:57 +0000 (envelope-from ) From: Greg Kroah-Hartman Subject: Re: [PATCH] TTY: n_gsm, fix false positive WARN_ON To: Dmitry Vyukov Cc: xinhui , Jiri Slaby , LKML , Alan Cox , stable Message-Id: <20160301171550.GA29081@kroah.com> References: <1448384067-27300-1-git-send-email-jslaby@suse.cz> <56555613.1040502@linux.vnet.ibm.com> <565585B9.4040706@suse.cz> <56558E48.3020604@linux.vnet.ibm.com> <20160301050124.GA19068@kroah.com> In-Reply-To: Date: Tue, 01 Mar 2016 17:15:54 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Tue, Mar 01, 2016 at 10:03:30AM +0100, Dmitry Vyukov wrote: > On Tue, Mar 1, 2016 at 6:01 AM, Greg Kroah-Hartman > wrote: > > On Sun, Feb 28, 2016 at 05:16:15PM +0100, Dmitry Vyukov wrote: > >> On Wed, Nov 25, 2015 at 11:32 AM, xinhui wrote: > >> > hi, Jiri > >> > > >> > On 2015/11/25 17:56, Jiri Slaby wrote: > >> >> > >> >> Hi, > >> >> > >> >> On 11/25/2015, 07:32 AM, xinhui wrote: > >> >>> > >> >>> This warning should blame on commit 5a640967 ("tty/n_gsm.c: fix a > >> >>> memory leak in gsmld_open()"). > >> >> > >> >> > >> >> Oh, yes, I messed up the "Fixes" line then. It should write: > >> >> Fixes: 5a640967 ("tty/n_gsm.c: fix a memory leak in gsmld_open()") > >> >> > >> > that's Okay. :) > >> > > >> >>> I have one confusion. As there is field gsm->num to store the index of > >> >>> gsm_mux[]. so in gsm_cleanup_mux(), why we still use for-loop to find > >> >>> this mux? > >> >>> > >> >>> In error handle path, for example, the call trace in this patch, as we > >> >>> failed to activate it and the > >> >>> gsm->num is invalid(and the value is 0). we can just modify the codes > >> >>> like below: > >> >>> > >> >>> if(gsm_mux[gsm->num] == gsm) > >> >>> ....other work > >> >>> else > >> >>> return; > >> >>> > >> >>> I think it would work, and the logic is correct. Or I just miss > >> >>> something important? > >> >> > >> >> > >> >> Yup, it looks like a cleanup. Could you prepare a separate patch for that? > >> >> > >> > yes, I will do that :) > >> > > >> >> Something like this: > >> >> /* open failed before registering => nothing to do */ > >> >> if (gsm_mux[gsm->num] != gsm) > >> >> return; > >> >> spin_lock(&gsm_mux_lock); > >> >> gsm_mux[gsm->num] = NULL; > >> >> spin_unlock(&gsm_mux_lock); > >> >> > >> > looks pretty good, thanks. > >> > >> > >> This is still not merged and fires regularly for me. Can we please merge it? > > > > merge what? I don't see any patch here or in my queue for this :( > > > "[PATCH] TTY: n_gsm, fix false positive WARN_ON" from Jiri Slaby: > https://lkml.org/lkml/2015/11/24/600 > > FWIW I have it in my tree for 3 months. Warnings have gone. No issues noticed. I don't see it in my queue, nor in Linus's tree, so someone needs to resend it if they want it merged into the kernel tree... {hint}