]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: call drv_stop only if driver is started
authorEliad Peller <eliad@wizery.com>
Sun, 25 Oct 2015 08:59:36 +0000 (10:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Nov 2015 09:41:12 +0000 (10:41 +0100)
commite2f481148c49f2b9daa1b661f76cdb16a97dd089
treedfe73df7dae4879fe96b045cdffc0d2d64e829be
parente2869da27220d59120b52d360a7864ddc0a75352
mac80211: call drv_stop only if driver is started

If drv_start() fails during hw_restart, all the running
interfaces are being closed/stopped, which results in
drv_stop() being called, although the driver was never
started successfully.

This might cause drivers to perform operations on uninitialized
memory (as they assume it was initialized on drv_start)

Consider the local->started flag, and call the driver's stop()
op only if drv_start() succeeded before.

Move drv_start() and drv_stop() to driver-ops.c, as they are no
longer simple wrappers.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/driver-ops.c
net/mac80211/driver-ops.h
net/mac80211/util.c