Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753966AbbFIVZd (ORCPT ); Tue, 9 Jun 2015 17:25:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34566 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbbFIVZY (ORCPT ); Tue, 9 Jun 2015 17:25:24 -0400 Date: Tue, 9 Jun 2015 14:25:23 -0700 From: Andrew Morton To: Sergey Senozhatsky Cc: Minchan Kim , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Michal Hocko , David Rientjes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, sergey.senozhatsky.work@gmail.com, Joe Perches Subject: Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools' destroy() functions Message-Id: <20150609142523.b717dba6033ee08de997c8be@linux-foundation.org> In-Reply-To: <1433851493-23685-1-git-send-email-sergey.senozhatsky@gmail.com> References: <1433851493-23685-1-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1053 Lines: 29 On Tue, 9 Jun 2015 21:04:48 +0900 Sergey Senozhatsky wrote: > The existing pools' destroy() functions do not allow NULL pool pointers; > instead, every destructor() caller forced to check if pool is not NULL, > which: > a) requires additional attention from developers/reviewers > b) may lead to a NULL pointer dereferences if (a) didn't work > > > First 3 patches tweak > - kmem_cache_destroy() > - mempool_destroy() > - dma_pool_destroy() > > to handle NULL pointers. Well I like it, even though it's going to cause a zillion little cleanup patches. checkpatch already has a "kfree(NULL) is safe and this check is probably not required" test so I guess Joe will need to get busy ;) I'll park these patches until after 4.1 is released - it's getting to that time... -- 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/