Re: [PATCH v2] locktorture: Fix NULL pointer when torture_type is invalid

From: Kefeng Wang
Date: Mon Mar 07 2016 - 21:12:29 EST




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