From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga03-in.huawei.com ([119.145.14.66]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZCImJ-0005Zm-NA for linux-mtd@lists.infradead.org; Tue, 07 Jul 2015 02:38:37 +0000 Message-ID: <559B3B4B.4010502@huawei.com> Date: Tue, 7 Jul 2015 10:36:59 +0800 From: Sheng Yong MIME-Version: 1.0 To: , CC: , Subject: Re: [PATCH V3 0/2] mtd: nandsim: fix error handling References: <1435198994-110948-1-git-send-email-shengyong1@huawei.com> In-Reply-To: <1435198994-110948-1-git-send-email-shengyong1@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Ping. thanks, Sheng On 6/25/2015 10:23 AM, Sheng Yong wrote: > V3: > Fix compiling error of PATCH 2 because of my silly bindly rebase without > testing :( These 2 patches are already tested. > > V2: > Resend the patches against l2-mtd/master. > > V1: > These 2 patches fix error handling when nandsim initialization fails. > > In alloc_device(), if creating slab memory fails, free_device() will try > to destroy the slab memory without checking if it exists. PATCH 1 fixes > it. > > If something goes wrong in init_nandsim(), it calls free_device() before > returning. However, the caller of init_nandsim() - ns_init_module() - also > does the cleanup by calling free_nandsim(). This causes double free. PATCH > 2 fixes it. > > Thanks, > Sheng > > Sheng Yong (2): > mtd: nandsim: fix free of NULL pointer > mtd: nandsim: fix double free > > drivers/mtd/nand/nandsim.c | 28 +++++++++------------------- > 1 file changed, 9 insertions(+), 19 deletions(-) >