[dpdk-dev] [PATCH v3 1/3] vhost: fix error path when setting memory tables

Maxime Coquelin maxime.coquelin at redhat.com
Thu Nov 12 18:00:18 CET 2020



On 11/11/20 7:06 AM, Xueming(Steven) Li wrote:
>> @@ -1012,16 +1018,13 @@ vhost_user_set_mem_table(struct virtio_net
>> **pdev, struct VhostUserMsg *msg,
>> 	if (memory->nregions > VHOST_MEMORY_MAX_NREGIONS) {
>> 		VHOST_LOG_CONFIG(ERR,
>> 			"too many memory regions (%u)\n", memory-
>>> nregions);
>> -		return RTE_VHOST_MSG_RESULT_ERR;
>> +		goto close_msg_fds;
>> 	}
>>
>> 	if (dev->mem && !vhost_memory_changed(memory, dev->mem)) {
>> 		VHOST_LOG_CONFIG(INFO,
>> 			"(%d) memory regions not changed\n", dev->vid);
>> -
>> -		close_msg_fds(msg);
>> -
>> -		return RTE_VHOST_MSG_RESULT_OK;
>> +		goto close_msg_fds;
> Return code will be changed to RTE_VHOST_MSG_RESULT_ERR, is this ok?
> 

Good catch, that is not OK to return RTE_VHOST_MSG_RESULT_ERR here.

Will fix in v3.

Thanks!
Maxime



More information about the dev mailing list