Commit c6968d4f authored by Anjaneyulu's avatar Anjaneyulu Committed by Johannes Berg
Browse files

wifi: mac80211: pass roc->sdata to drv_cancel_remain_on_channel()



In suspend flow "sdata" is NULL, destroy all roc's which are started.
pass "roc->sdata" to drv_cancel_remain_on_channel() to avoid NULL
dereference and destroy that roc

Signed-off-by: default avatarAnjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230608163202.c678187a308c.Ic11578778655e273931efc5355d570a16465d1be@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 4c2d68f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
 * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
 * Copyright 2009	Johannes Berg <johannes@sipsolutions.net>
 * Copyright (C) 2019, 2022 Intel Corporation
 * Copyright (C) 2019, 2022-2023 Intel Corporation
 */
#include <linux/export.h>
#include <net/mac80211.h>
@@ -1014,7 +1014,7 @@ void ieee80211_roc_purge(struct ieee80211_local *local,
		if (roc->started) {
			if (local->ops->remain_on_channel) {
				/* can race, so ignore return value */
				drv_cancel_remain_on_channel(local, sdata);
				drv_cancel_remain_on_channel(local, roc->sdata);
				ieee80211_roc_notify_destroy(roc);
			} else {
				roc->abort = true;