Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753989AbbFKAsT (ORCPT ); Wed, 10 Jun 2015 20:48:19 -0400 Received: from smtprelay0011.hostedemail.com ([216.40.44.11]:35846 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751783AbbFKAsK (ORCPT ); Wed, 10 Jun 2015 20:48:10 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2525:2553:2560:2563:2682:2685:2828:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:6261:6742:7514:7903:9010:9025:10004:10400:10848:11026:11232:11658:11914:12043:12114:12517:12519:12740:13069:13141:13161:13229:13230:13255:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: spark80_641172520563c X-Filterd-Recvd-Size: 2661 Message-ID: <1433983686.32331.35.camel@perches.com> Subject: Re: [RFC][PATCH 4/5] mm/zpool: allow NULL `zpool' pointer in zpool_destroy_pool() From: Joe Perches To: Sergey Senozhatsky Cc: Dan Streetman , Sergey Senozhatsky , Andrew Morton , Minchan Kim , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Michal Hocko , David Rientjes , Linux-MM , linux-kernel Date: Wed, 10 Jun 2015 17:48:06 -0700 In-Reply-To: <20150610235836.GB499@swordfish> References: <1433851493-23685-1-git-send-email-sergey.senozhatsky@gmail.com> <1433851493-23685-5-git-send-email-sergey.senozhatsky@gmail.com> <20150610235836.GB499@swordfish> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1491 Lines: 40 On Thu, 2015-06-11 at 08:58 +0900, Sergey Senozhatsky wrote: > On (06/10/15 16:59), Dan Streetman wrote: > > On Tue, Jun 9, 2015 at 8:04 AM, Sergey Senozhatsky > > wrote: > > > zpool_destroy_pool() does not tolerate a NULL zpool pointer > > > argument and performs a NULL-pointer dereference. Although > > > there is only one zpool_destroy_pool() user (as of 4.1), > > > still update it to be coherent with the corresponding > > > destroy() functions of the remainig pool-allocators (slab, > > > mempool, etc.), which now allow NULL pool-pointers. > > > > > > For consistency, tweak zpool_destroy_pool() and NULL-check the > > > pointer there. > > > > > > Proposed by Andrew Morton. > > > > > > Signed-off-by: Sergey Senozhatsky > > > Reported-by: Andrew Morton > > > LKML-reference: https://lkml.org/lkml/2015/6/8/583 > > > > Acked-by: Dan Streetman > > Thanks. > > Shall we ask Joe to add zpool_destroy_pool() to the > "$func(NULL) is safe and this check is probably not required" list? [] Is it really worth it? There isn't any use of zpool_destroy_pool preceded by an if There is one and only one use of zpool_destroy_pool. -- 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/