From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from a.ns.miles-group.at ([95.130.255.143] helo=radon.swed.at) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z7Hfp-0007X7-Oe for linux-mtd@lists.infradead.org; Tue, 23 Jun 2015 06:27:11 +0000 Message-ID: <5588FC20.4020600@nod.at> Date: Tue, 23 Jun 2015 08:26:40 +0200 From: Richard Weinberger MIME-Version: 1.0 To: Sheng Yong , computersforpeace@gmail.com, dwmw2@infradead.org Subject: Re: [PATCH 0/2] mtd: nandsim: fix error handling References: <1434530713-81591-1-git-send-email-shengyong1@huawei.com> <5588B07E.4080404@huawei.com> In-Reply-To: <5588B07E.4080404@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-mtd@lists.infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Am 23.06.2015 um 03:03 schrieb Sheng Yong: > Ping. Any comments are appreciated :) > > thanks, > Sheng > > On 6/17/2015 4:45 PM, Sheng Yong wrote: >> 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 Both patches look good to me. Thanks, //richard