Re: [PATCH] net/mlx4_core: fix handling return value of mlx4_slave_convert_port
From: Or GerlitzDate: Tue, 15 Dec 2015 11:09:40 +0200 > On 12/14/2015 12:05 PM, Andrzej Hajda wrote: >> The function can return negative values, so its result should >> be assigned to signed variable. >> >> The problem has been detected using proposed semantic patch >> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. >> >> [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 >> > > Please add here > > Fixes: fc48866f7 ('net/mlx4: Adapt code for N-Port VF') > >> Signed-off-by: Andrzej Hajda > > otherwise, Looks good > > Acked-by: Or Gerlitz Applied with Fixes tag added. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] net/mlx4_core: fix handling return value of mlx4_slave_convert_port
On 12/14/2015 12:05 PM, Andrzej Hajda wrote: The function can return negative values, so its result should be assigned to signed variable. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Please add here Fixes: fc48866f7 ('net/mlx4: Adapt code for N-Port VF') Signed-off-by: Andrzej Hajdaotherwise, Looks good Acked-by: Or Gerlitz Or. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] net/mlx4_core: fix handling return value of mlx4_slave_convert_port
The function can return negative values, so its result should be assigned to signed variable. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda--- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index da7f578..b46dbe2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -4331,9 +4331,10 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, return -EOPNOTSUPP; ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; - ctrl->port = mlx4_slave_convert_port(dev, slave, ctrl->port); - if (ctrl->port <= 0) + err = mlx4_slave_convert_port(dev, slave, ctrl->port); + if (err <= 0) return -EINVAL; + ctrl->port = err; qpn = be32_to_cpu(ctrl->qpn) & 0xff; err = get_res(dev, slave, qpn, RES_QP, ); if (err) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html