[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <565585B9.4040706@suse.cz>
Date: Wed, 25 Nov 2015 10:56:09 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: xinhui <xinhui@...ux.vnet.ibm.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: dvyukov@...gle.com, linux-kernel@...r.kernel.org,
Alan Cox <alan@...ux.intel.com>,
stable <stable@...r.kernel.org>
Subject: Re: [PATCH] TTY: n_gsm, fix false positive WARN_ON
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()")
> 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?
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);
thanks,
--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists