[Devel] [PATCH 1/1] Drivers: md: ploop - Do not leak a page on allocation failure

Alexander Atanasov alexander.atanasov at virtuozzo.com
Thu Jul 21 10:13:04 MSK 2022


Hi,

On 20/07/2022 21:07, Vasily Averin wrote:
> On 7/20/22 21:02, Alexander Atanasov wrote:
>> Hi,
>>
>> On 20/07/2022 20:57, Vasily Averin wrote:
>>
>>> Hi Alexander!
>>>
>>> On 7/20/22 14:05, Alexander Atanasov wrote:
>>>> Fix off-by-one error - tries to free the failed allocation and
>>>> it leaks the first successful
>>> Could you please elaborate? I do not see the difference in behavior.
>>>
>>> if we have failed on 2nd allocation
>>> we have i = 1
>>> io_vec[0] was set
>>> io_vec[1] was failed
>>> we jump to err: label
>>> doing i-- end call put_page for io_vec[0]
>>> 2nd turn fails.
>>> So looks like all works correctly.
>>> With your patch situation is not changed.
>>>
>>> Am I missed something perhaps?
>>
>> No, of course you are not. My bad i overlooked it. Please, ignore.
> Do not worry, you are fine!

Thanks, I appreciate it all!

-- 
Regards,
Alexander Atanasov



More information about the Devel mailing list