Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751643AbcCHTwI (ORCPT ); Tue, 8 Mar 2016 14:52:08 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:39913 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751021AbcCHTvy (ORCPT ); Tue, 8 Mar 2016 14:51:54 -0500 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Tue, 8 Mar 2016 11:51:55 -0800 From: "Paul E. McKenney" To: Kefeng Wang Cc: Davidlohr Bueso , linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, Josh Triplett , "Guohanjun (Hanjun Guo)" Subject: Re: [PATCH v2] locktorture: Fix NULL pointer when torture_type is invalid Message-ID: <20160308195155.GY3577@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20160302195543.GA12593@linux-uzut.site> <20160302211216.GC3577@linux.vnet.ibm.com> <56D79566.7010302@huawei.com> <56D7BE33.5010605@huawei.com> <20160303083626.GA10957@linux-uzut.site> <56DCE0D4.1060109@huawei.com> <20160307054007.GA8192@linux-uzut.site> <56DD276D.1070607@huawei.com> <20160307133745.GQ3577@linux.vnet.ibm.com> <56DE34AC.3020902@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56DE34AC.3020902@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030819-0025-0000-0000-0000223E88F9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1306 Lines: 38 On Tue, Mar 08, 2016 at 10:10:52AM +0800, Kefeng Wang wrote: > > > On 2016/3/7 21:37, Paul E. McKenney wrote: > > On Mon, Mar 07, 2016 at 03:02:05PM +0800, Kefeng Wang wrote: > >> > >> > >> On 2016/3/7 13:40, Davidlohr Bueso wrote: > >>> On Mon, 07 Mar 2016, Kefeng Wang wrote: > >>>> On 2016/3/3 16:36, Davidlohr Bueso wrote: > >>> > >>>>> + /* > >>>>> + * Indicates early cleanup, meaning that the test has not run, > >>>>> + * such as when passing bogus args when loading the module. As > >>>>> + * such, only perform the underlying torture-specific cleanups, > >>>>> + * and avoid anything related to locktorture. > >>>>> + */ > >>>>> + if (!cxt.lwsa) > >>>>> + goto end; > >>>> > >>>> Sorry for the late response, the cxt.lrsa should be taken into account too. > >>> > >>> I am taking it into account, note that we kfree lwsa if lrsa fails memory > >>> allocation. Of course we should be defensive, so go ahead and explicitly set > >>> it to nil. v2 below, otherwise same patch. > >> > >> This one looks good, and tested on my board. > > > > Very good! May we add your Tested-by? > > Sure, please. Thank you, Kefeng! Davidlohr, I tried applying your patches and got conflicts. Could you please port them to -rcu and send me clean versions? Thanx, Paul