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: b14e8a57b9fe ("net/iavf: support quanta size configuration")
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
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: