From: David Miller Subject: Re: [Patch net] net/wan: fix a double free in x25_asy_open_tty() Date: Sun, 30 Dec 2018 20:23:35 -0800 (PST) Message-ID: <20181230.202335.1364857894288732216.davem@davemloft.net> References: <20181229215638.10590-1-xiyou.wangcong@gmail.com> <20181229215638.10590-2-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: xiyou.wangcong@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:35848 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbeLaEXg (ORCPT ); Sun, 30 Dec 2018 23:23:36 -0500 In-Reply-To: <20181229215638.10590-2-xiyou.wangcong@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Cong Wang Date: Sat, 29 Dec 2018 13:56:37 -0800 > When x25_asy_open() fails, it already cleans up by itself, > so its caller doesn't need to free the memory again. > > It seems we still have to call x25_asy_free() to clear the SLF_INUSE > bit, so just set these pointers to NULL after kfree(). > > Reported-and-tested-by: syzbot+5e5e969e525129229052@syzkaller.appspotmail.com > Fixes: 3b780bed3138 ("x25_asy: Free x25_asy on x25_asy_open() failure.") > Signed-off-by: Cong Wang Applied and queued up for -stable, thanks Cong.