From: Johannes Berg Date: Tue, 5 Jun 2012 17:56:06 +0000 (+0200) Subject: iwlwifi: fix double free/complete in firmware loading X-Git-Tag: v3.5-rc3~22^2~10^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f69a23b795d6ee3673583146ed7efcbaaa5add18;p=pandora-kernel.git iwlwifi: fix double free/complete in firmware loading Linus reported that due to mac80211 failing to register the device (due to WoWLAN) his machine crashed etc. as we double-freed the vmalloc() firmware area. His patch to fix it was very similar to this one but I noticed that there's another bug in the area: we complete the completion before starting, so since we're running in a work struct context stop() could be called while in the middle of start() which will almost certainly lead to issues. Make a modification similar to his to avoid the double- free but also move the completion to another spot so it is only done after start() either finished or failed so that stop() can have a consistent state. Reported-by: Linus Torvalds Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- Reading git-diff-tree failed