Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx5: Fix an IS_ERR() vs NULL bug in esw_qos_move_node()

The __esw_qos_alloc_node() function returns NULL on error. It doesn't
return error pointers. Update the error checking to match.

Fixes: 96619c485fa6 ("net/mlx5: Add support for setting tc-bw on nodes")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/0ce4ec2a-2b5d-4652-9638-e715a99902a7@sabinyo.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Dan Carpenter and committed by
Jakub Kicinski
49be1e24 c2fe3b2a

+3 -2
+3 -2
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
··· 1405 1405 1406 1406 new_node = __esw_qos_alloc_node(curr_node->esw, curr_node->ix, 1407 1407 curr_node->type, NULL); 1408 - if (!IS_ERR(new_node)) 1409 - esw_qos_nodes_set_parent(&curr_node->children, new_node); 1408 + if (!new_node) 1409 + return ERR_PTR(-ENOMEM); 1410 1410 1411 + esw_qos_nodes_set_parent(&curr_node->children, new_node); 1411 1412 return new_node; 1412 1413 } 1413 1414