summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGaosheng Cui <cuigaosheng1@huawei.com>2022-12-14 09:01:17 +0100
committerPaolo Abeni <pabeni@redhat.com>2022-12-15 14:00:34 +0100
commit2cb815cfc78b137ee38bcd65e7c955d6cc2cc250 (patch)
tree0b025ec71b2625e03ee1aaee3895974acef557f9 /drivers/net
parentr6040: Fix kmemleak in probe and remove (diff)
downloadlinux-2cb815cfc78b137ee38bcd65e7c955d6cc2cc250.tar.xz
linux-2cb815cfc78b137ee38bcd65e7c955d6cc2cc250.zip
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@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20221214080117.3514615-1-cuigaosheng1@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c1
1 files changed, 1 insertions, 0 deletions
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;
}