Skip to content

Commit 83300c6

Browse files
Yang Yingliangdavem330
authored andcommitted
net: sparx5: fix error return code in sparx5_register_notifier_blocks()
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 <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8f4c38f commit 83300c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,10 @@ int sparx5_register_notifier_blocks(struct sparx5 *s5)
485485
goto err_switchdev_blocking_nb;
486486

487487
sparx5_owq = alloc_ordered_workqueue("sparx5_order", 0);
488-
if (!sparx5_owq)
488+
if (!sparx5_owq) {
489+
err = -ENOMEM;
489490
goto err_switchdev_blocking_nb;
491+
}
490492

491493
return 0;
492494

0 commit comments

Comments
 (0)