]> git.baikalelectronics.ru Git - kernel.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)
commite95f24100e390277f05444a161ffc581b8021eaf
tree00d5c753c8b2b25a6471743a6b7d459a853c4a9b
parent7666aebf31b280e014d61bafc94f3b7fa09aa447
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