1: 9c5e4b222fc6 ! 1: 00ec218d502a wifi: iwlegacy: unregister the LED if 3945 hardware registration fails @@ Metadata ## Commit message ## wifi: iwlegacy: unregister the LED if 3945 hardware registration fails  - If ieee80211_register_hw() fails during 3945 setup, later LED callbacks - can access hardware and driver state that probe has already freed. + If ieee80211_register_hw() fails during 3945 probe, the LED class device + stays registered after probe frees the il_priv that embeds it. The next + LED trigger registration, or a write to the LED's sysfs brightness file, + then uses freed memory.  - il3945_setup_mac() registers the LED before the mac80211 hardware, but - its registration error path does not call il_leds_exit(). The analogous - 4965 failure releases the driver and reaches its existing remove cleanup. + il3945_setup_mac() registers the LED before the mac80211 hardware, and + il3945_pci_probe() unwinds a registration failure without calling + il_leds_exit(). 4965 already performs this cleanup: when + il4965_mac_setup_register() fails, il4965_ucode_callback() calls + device_release_driver(), and il4965_pci_remove() then calls + il_leds_exit().  Unregister the 3945 LED before unwinding a failed hardware registration.