aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorAmir Vadai <amirv@mellanox.com>2013-11-07 04:08:30 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-07 19:11:13 -0500
commit1ec4864b10171b0691ee196d7006ae56d2c153f2 (patch)
treef0eb31f3ede41b22cf497cd14106224321555229 /drivers/net/ethernet
parent5600090eb138e302636dea7d44c63e3d7c890725 (diff)
net/mlx4_en: Fixed crash when port type is changed
timecounter_init() was was called only after first potential timecounter_read(). Moved mlx4_en_init_timestamp() before mlx4_en_init_netdev() Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
index a071cda2dd04..0d087b03a7b0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
@@ -264,6 +264,10 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
264 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) 264 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
265 mdev->port_cnt++; 265 mdev->port_cnt++;
266 266
267 /* Initialize time stamp mechanism */
268 if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
269 mlx4_en_init_timestamp(mdev);
270
267 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { 271 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) {
268 if (!dev->caps.comp_pool) { 272 if (!dev->caps.comp_pool) {
269 mdev->profile.prof[i].rx_ring_num = 273 mdev->profile.prof[i].rx_ring_num =
@@ -301,10 +305,6 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
301 mdev->pndev[i] = NULL; 305 mdev->pndev[i] = NULL;
302 } 306 }
303 307
304 /* Initialize time stamp mechanism */
305 if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
306 mlx4_en_init_timestamp(mdev);
307
308 return mdev; 308 return mdev;
309 309
310err_mr: 310err_mr: