Skip to content

Commit

Permalink
net: sparx5: fix error return code in sparx5_register_notifier_blocks()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: d6fce51 ("net: sparx5: add switching support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Yingliang authored and David S. Miller committed Jun 28, 2021
1 parent 8f4c38f commit 83300c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,10 @@ int sparx5_register_notifier_blocks(struct sparx5 *s5)
goto err_switchdev_blocking_nb;

sparx5_owq = alloc_ordered_workqueue("sparx5_order", 0);
if (!sparx5_owq)
if (!sparx5_owq) {
err = -ENOMEM;
goto err_switchdev_blocking_nb;
}

return 0;

Expand Down

0 comments on commit 83300c6

Please sign in to comment.