Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753272AbYKRN5p (ORCPT ); Tue, 18 Nov 2008 08:57:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752178AbYKRN5g (ORCPT ); Tue, 18 Nov 2008 08:57:36 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:36026 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbYKRN5f (ORCPT ); Tue, 18 Nov 2008 08:57:35 -0500 Subject: Re: [PATCH] physmap: Fix leak of memory returned by parse_mtd_partitions From: David Woodhouse To: Mike Frysinger Cc: Atsushi Nemoto , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <8bd0f97a0811120808p5858d5adleeef43b1d374bee1@mail.gmail.com> References: <20081112.235733.01917391.anemo@mba.ocn.ne.jp> <20081113.005534.56563769.anemo@mba.ocn.ne.jp> <8bd0f97a0811120808p5858d5adleeef43b1d374bee1@mail.gmail.com> Content-Type: text/plain Date: Tue, 18 Nov 2008 13:57:27 +0000 Message-Id: <1227016647.27728.398.camel@macbook.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 29 On Wed, 2008-11-12 at 11:08 -0500, Mike Frysinger wrote: > i wonder why we duplicate this same code block in so many places. and > why does every driver have to declare its own list of parsers ? cant > we unify all of these in one place ? Well, most boards only really want _one_ partition type; maybe two. And the probes can be quite expensive and have false positives, so we don't want to be doing all the probes for all devices. It might make sense to just pass a bitmask indicating which partition probes to use. Assuming we can agree on an ordering, that is :) Another complication is that some boards have registered the whole device first, while others have just registered the partitions. I suspect it might be better to take the simple bug-fix approach for now, given that we are planning a revamp of the MTD core API anyway -- we can redo partitions properly at the point, so they aren't just an evil hack. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation -- 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/