net/iavf: fix memory leak

Set an invalid quanta size from devargs will cause memory leak and this
is reported by coverity.

The patch fix the issue by correcting the error handle.

Coverity issue: 378017
Fixes: b14e8a57b9 ("net/iavf: support quanta size configuration")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
Wenjun Wu 2022-05-10 08:54:25 +08:00 committed by Qi Zhang
parent c98600d4be
commit f3548646db

View File

@ -2188,7 +2188,8 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
if (ad->devargs.quanta_size < 256 || ad->devargs.quanta_size > 4096 ||
ad->devargs.quanta_size & 0x40) {
PMD_INIT_LOG(ERR, "invalid quanta size\n");
return -EINVAL;
ret = -EINVAL;
goto bail;
}
bail: