Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932262AbcCHCMS (ORCPT ); Mon, 7 Mar 2016 21:12:18 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:35321 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753411AbcCHCMJ (ORCPT ); Mon, 7 Mar 2016 21:12:09 -0500 Subject: Re: [PATCH v2] locktorture: Fix NULL pointer when torture_type is invalid To: References: <20160202064635.GH6719@linux.vnet.ibm.com> <20160203002331.GA3385@linux-uzut.site> <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> CC: Davidlohr Bueso , , , , Josh Triplett , "Guohanjun (Hanjun Guo)" From: Kefeng Wang Message-ID: <56DE34AC.3020902@huawei.com> Date: Tue, 8 Mar 2016 10:10:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160307133745.GQ3577@linux.vnet.ibm.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.180] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56DE34B9.00EC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6e0cf938adb5ef7f5022f5db31486df0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1046 Lines: 34 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. > > Thanx, Paul