]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Properly access RCU protected qdisc_sleeping variable
authorLeon Romanovsky <leonro@nvidia.com>
Wed, 16 Jul 2025 14:17:49 +0000 (17:17 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:25:55 +0000 (16:25 +0200)
commit16db6552221939d11bb3c73c5d39a85ea8a195b1
tree0897c494cdd9368dc44209077e609f72c62e5f29
parent83a798cee6a46ea85de19f85853f5d2eb38fc1f7
net/mlx5e: Properly access RCU protected qdisc_sleeping variable

[ Upstream commit 2a601b2d35623065d31ebaf697b07502d54878c9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c