]> git.karo-electronics.de Git - karo-tx-linux.git/commit
net/mlx5e: Avoid accessing NULL pointer at ndo_select_queue
authorRana Shahout <ranas@mellanox.com>
Sun, 23 Aug 2015 13:12:14 +0000 (16:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2015 20:45:09 +0000 (13:45 -0700)
commit5283af899adec1a7765e413e43b27a335fadac5d
tree00d5c753c8b2b25a6471743a6b7d459a853c4a9b
parent94c10f0ea303473884f69edd6bbb0cedcf570105
net/mlx5e: Avoid accessing NULL pointer at ndo_select_queue

To avoid multiply/division operations on the data path,
we hold a {channel, tc}==>txq mapping table.
We held this mapping table inside the channel object that is
being destroyed upon some configuration operations (e.g MTU change).
So in case ndo_select_queue occurs during such a configuration operation,
it may access a NULL channel pointer, resulting in kernel panic.
To fix this issue we moved the {channel, tc}==>txq mapping table
outside the channel object so that it will be available also
during such configuration operations.

Signed-off-by: Rana Shahout <ranas@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c