]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: mvm: check time-event vif to avoid bad deletion
authorJohannes Berg <johannes.berg@intel.com>
Fri, 26 Jun 2015 14:04:01 +0000 (16:04 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 12 Jul 2015 16:54:17 +0000 (19:54 +0300)
commitaeab21bcd1b2c1ab957fd2c04b42d4b6f2d37d89
treedefcedaa33e3312e51b385050b3501af758eb629
parentdea82d7dec7adb3459a93580d27a9450da88f385
iwlwifi: mvm: check time-event vif to avoid bad deletion

The time event is initialized relatively late in interface (mvmvif)
initialization, so it's possible to fail before that happens. As a
consequence, the driver will crash if it ever tries to delete this
time event in case initialization was unsuccessful.

Avoid this by using the time event's vif pointer to indicate validity.
The vif pointer is != NULL whenever the id is != TE_MAX, except for
this special error case where the vif pointer will have the correct
property (as the whole memory is cleared on allocation) whereas the
id is 0, causing a crash in trying to delete the time event from the
list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/time-event.c