mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
net/mlx5e: Properly access RCU protected qdisc_sleeping variable
qdisc_sleeping variable is declared as "struct Qdisc __rcu" and as such needs proper annotation while accessing it. Without rtnl_dereference(), the following error is generated by sparse: drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: warning: incorrect type in initializer (different address spaces) drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: expected struct Qdisc *qdisc drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: got struct Qdisc [noderef] __rcu *qdisc_sleeping Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Link: https://patch.msgid.link/1752675472-201445-4-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
394d31d52f
commit
2a601b2d35
|
|
@ -374,7 +374,7 @@ void mlx5e_reactivate_qos_sq(struct mlx5e_priv *priv, u16 qid, struct netdev_que
|
|||
void mlx5e_reset_qdisc(struct net_device *dev, u16 qid)
|
||||
{
|
||||
struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, qid);
|
||||
struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
|
||||
struct Qdisc *qdisc = rtnl_dereference(dev_queue->qdisc_sleeping);
|
||||
|
||||
if (!qdisc)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user