]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: Fix per port reporter fields initialization
authorParav Pandit <parav@nvidia.com>
Fri, 21 Aug 2020 19:12:20 +0000 (22:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Aug 2020 23:02:46 +0000 (16:02 -0700)
commitfc2b82d1177c165f3c9814c01f9037a3aada7b51
tree8b13fe8047c752e6e6c03cdf493b260976fdaad7
parentf4830e8bac995a5df38244294f5451cfdd9070c6
devlink: Fix per port reporter fields initialization

Cited patch in fixes tag initializes reporters_list and reporters_lock
of a devlink port after devlink port is added to the list. Once port
is added to the list, devlink_nl_cmd_health_reporter_get_dumpit()
can access the uninitialized mutex and reporters list head.
Fix it by initializing port reporters field before adding port to the
list.

Fixes: 5c243a048d48 ("devlink: Implement devlink health reporters on per-port basis")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c