From: Johannes Berg In nl80211_pre_doit(), we assign an ERR_PTR to wdev and jump the 'out' label, which looks like it can try to wdev_put() this wdev. That can't happen as it's gated by a check for wdev_ref which is never true in this path, but the dependency isn't always clear to static checkers. Set wdev to NULL. Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 2fc680382418..80f094d9b2fb 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -20209,6 +20209,7 @@ static int nl80211_pre_doit(const struct genl_split_ops *ops, wdev = nl80211_lock_and_recheck(rdev, netns, wdev_id); if (IS_ERR(wdev)) { err = PTR_ERR(wdev); + wdev = NULL; goto out; } } -- 2.56.0