From f3548646dbad2cd6a01c2c1c1394a53ece5f513a Mon Sep 17 00:00:00 2001 From: Wenjun Wu Date: Tue, 10 May 2022 08:54:25 +0800 Subject: [PATCH] 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: b14e8a57b9fe ("net/iavf: support quanta size configuration") Signed-off-by: Wenjun Wu Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index d1a2b53675..82672841f4 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -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: -- 2.20.1