qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 for-2.10 13/18] crypto: cipher: add afalg-bac


From: Longpeng (Mike)
Subject: Re: [Qemu-devel] [PATCH v2 for-2.10 13/18] crypto: cipher: add afalg-backend cipher support
Date: Sat, 22 Apr 2017 10:04:10 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1


On 2017/4/22 9:51, Gonglei (Arei) wrote:

>>
>>
>> On 2017/4/21 20:59, Gonglei (Arei) wrote:
>>
>>>
>>>> -----Original Message-----
>>>> From: longpeng
>>>> Sent: Monday, April 17, 2017 9:33 AM
>>>> To: address@hidden
>>>> Cc: Gonglei (Arei); Huangweidong (C); address@hidden;
>>>> address@hidden; address@hidden; address@hidden;
>> longpeng
>>>> Subject: [PATCH v2 for-2.10 13/18] crypto: cipher: add afalg-backend cipher
>>>> support
>>>>
>>>> Adds afalg-backend cipher support: introduces some private APIs
>>>> firstly, and then intergrates them into qcrypto_cipher_afalg_driver.
>>>>
>>>> Signed-off-by: Longpeng(Mike) <address@hidden>
>>>> ---

>>>> +    char *name;
>>>> +
>>>> +    name = qcrypto_afalg_cipher_format_name(alg, mode, errp);
>>>> +    if (!name) {
>>>> +        return NULL;
>>>> +    }
>>>> +
>>>> +    afalg = qcrypto_afalg_comm_alloc(AFALG_TYPE_CIPHER, name, errp);
>>>> +    if (!afalg) {
>>>> +        goto error;
>>>
>>> Leak memory pointed by name.
>>>
>>
>>
>> It won't.
>>
>> If failed, the control flow is error->cleanup->return, and 'name' will be 
>> freed
>> in 'cleanup'.
>>
>> If this method success, then the control flow is cleanup->return, 'name' will
>> also be freed.
>>
> I see. I suggest you can store the name pointer in afalg, then its easily to 
> free
> it in qcrypto_afalg_comm_free(), and we can get enough information about
> the alg/mode if needed.
> 


All right, thanks. :)

> Thanks,
> -Gonglei
> 
> .
> 


-- 
Regards,
Longpeng(Mike)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]