Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734Ab3FDItt (ORCPT ); Tue, 4 Jun 2013 04:49:49 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:34486 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011Ab3FDItq (ORCPT ); Tue, 4 Jun 2013 04:49:46 -0400 Date: Tue, 4 Jun 2013 11:49:16 +0300 From: Dan Carpenter To: Jiang Liu Cc: Greg Kroah-Hartman , Nitin Gupta , Minchan Kim , Jerome Marchand , Yijing Wang , devel@driverdev.osuosl.org, Jiang Liu , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1 4/8] zram: destroy all devices on error recovery path in zram_init() Message-ID: <20130604084916.GM28112@mwanda> References: <1370274140-26420-1-git-send-email-jiang.liu@huawei.com> <1370274140-26420-5-git-send-email-jiang.liu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370274140-26420-5-git-send-email-jiang.liu@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 844 Lines: 24 Everyone stop putting RFC on their bugfixes! :P No one wants to pre-review patches. On Mon, Jun 03, 2013 at 11:42:16PM +0800, Jiang Liu wrote: > On error recovery path of zram_init(), it leaks the zram device object > causing the failure. > This is a real bug but the fix isn't right. The object causing the failure has only been partially set up. And in some cases it has been partially cleaned up, for example we could end up releasing ->queue twice. The better way is to make create_device() clean up after itself completely instead of only partly and sometimes. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/