Skip to content

Commit 2cb815c

Browse files
gscuiPaolo Abeni
authored andcommitted
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: a137f3f ("net: stmmac: fix possible memory leak in stmmac_dvr_probe()") Signed-off-by: Gaosheng Cui <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 7e43039 commit 2cb815c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7099,6 +7099,7 @@ int stmmac_dvr_probe(struct device *device,
70997099
priv->wq = create_singlethread_workqueue("stmmac_wq");
71007100
if (!priv->wq) {
71017101
dev_err(priv->device, "failed to create workqueue\n");
7102+
ret = -ENOMEM;
71027103
goto error_wq_init;
71037104
}
71047105

0 commit comments

Comments
 (0)