Commit 504776be authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Johannes Berg
Browse files

nl80211: Simplify error handling path in 'nl80211_trigger_scan()'



Re-write the end of 'nl80211_trigger_scan()' with a more standard, easy to
understand and future proof version.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200712173551.274448-1-christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 83286856
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -7993,15 +7993,18 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
	rdev->scan_req = request;
	err = rdev_scan(rdev, request);

	if (!err) {
	if (err)
		goto out_free;

	nl80211_send_scan_start(rdev, wdev);
	if (wdev->netdev)
		dev_hold(wdev->netdev);
	} else {

	return 0;

 out_free:
	rdev->scan_req = NULL;
	kfree(request);
	}

	return err;
}