[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221214080117.3514615-1-cuigaosheng1@huawei.com>
Date: Wed, 14 Dec 2022 16:01:17 +0800
From: Gaosheng Cui <cuigaosheng1@...wei.com>
To: <peppe.cavallaro@...com>, <alexandre.torgue@...s.st.com>,
<joabreu@...opsys.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<mcoquelin.stm32@...il.com>, <ast@...nel.org>,
<daniel@...earbox.net>, <hawk@...nel.org>,
<john.fastabend@...il.com>, <boon.leong.ong@...el.com>,
<cuigaosheng1@...wei.com>
CC: <netdev@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>
Subject: [PATCH net,v2] net: stmmac: fix errno when create_singlethread_workqueue() fails
We should set the return value to -ENOMEM explicitly when
create_singlethread_workqueue() fails in stmmac_dvr_probe(),
otherwise we'll lose the error value.
Fixes: a137f3f27f92 ("net: stmmac: fix possible memory leak in stmmac_dvr_probe()")
Signed-off-by: Gaosheng Cui <cuigaosheng1@...wei.com>
---
v2:
- Change title of this patch to be "PATCH net", thanks!
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index ec64b65dee34..c6951c976f5d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7099,6 +7099,7 @@ int stmmac_dvr_probe(struct device *device,
priv->wq = create_singlethread_workqueue("stmmac_wq");
if (!priv->wq) {
dev_err(priv->device, "failed to create workqueue\n");
+ ret = -ENOMEM;
goto error_wq_init;
}
--
2.25.1
Powered by blists - more mailing lists