orinoco: Do not call wiphy_unregister() from free_orinocodev()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Thu, 6 Aug 2015 16:46:31 +0000 (12:46 -0400)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 13 Aug 2015 12:36:47 +0000 (15:36 +0300)
commit94fdc2e627d1b479a117cd8b9ece5f4613a5c956
tree125033af6b6efbc00aa7c8c8b59a7479586d2416
parentcb9d61e5304e2880180e4ccf685a298c868094e0
orinoco: Do not call wiphy_unregister() from free_orinocodev()

alloc_orinocodev() would allocate the wiphy entry, but it would only get
registered much later in orinoco_init(). If something failed in the init
process inbetween the call to alloc_orinocodev() and the completion
of orinoco_init(), the drivers would end up calling wiphy_unregister()
with a NULL pointer causing beautiful OOPS fireworks.

Explicitly call wiphy_unregister() instead in the right places.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/orinoco/main.c
drivers/net/wireless/orinoco/orinoco_cs.c
drivers/net/wireless/orinoco/orinoco_nortel.c
drivers/net/wireless/orinoco/orinoco_pci.c
drivers/net/wireless/orinoco/orinoco_plx.c
drivers/net/wireless/orinoco/orinoco_usb.c