net: hsr: fix hsr build error when lockdep is not enabled
authorJuhee Kang <claudiajkang@gmail.com>
Sun, 20 Feb 2022 15:32:50 +0000 (15:32 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 22 Feb 2022 04:43:10 +0000 (20:43 -0800)
commita0b92e0514bb3c5e57c33fd720724a629f67e042
treefae08e62f84df38c62de933e627229b72e3fa056
parent7b779cc8846ae0bfdad8eca7b751109a5cf930b7
net: hsr: fix hsr build error when lockdep is not enabled

In hsr, lockdep_is_held() is needed for rcu_dereference_bh_check().
But if lockdep is not enabled, lockdep_is_held() causes a build error:

    ERROR: modpost: "lockdep_is_held" [net/hsr/hsr.ko] undefined!

Thus, this patch solved by adding lockdep_hsr_is_held(). This helper
function calls the lockdep_is_held() when lockdep is enabled, and returns 1
if not defined.

Fixes: e7f27420681f ("net: hsr: fix suspicious RCU usage warning in hsr_node_get_first()")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Link: https://lore.kernel.org/r/20220220153250.5285-1-claudiajkang@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/hsr/hsr_framereg.c
net/hsr/hsr_framereg.h