net/mlx4_core: fix handling return value of mlx4_slave_convert_port
authorAndrzej Hajda <a.hajda@samsung.com>
Mon, 14 Dec 2015 10:05:58 +0000 (11:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Dec 2015 16:54:43 +0000 (11:54 -0500)
commit2b2b31c845d3dec6f9960db92d0993ddfc2d2b7f
tree0cbb3d3e54f22b961f737954f80a9f99766121e5
parentf654861569872d10dcb79d9d7ca219b316f94ff0
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

Fixes: fc48866f7 ('net/mlx4: Adapt code for N-Port VF')
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c