]> git.hungrycats.org Git - linux/commit
wifi: mt76: mt792x: fix NULL dereference in ACPI SAR init during probe
authorDevin Wittmayer <lucid_duck@justthetip.ca>
Tue, 25 Aug 2026 18:17:12 +0000 (11:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 13 Sep 2026 17:15:16 +0000 (10:15 -0700)
commit7825de3f75d184612d77655669a04ea0da252c17
tree778300c7dac6832f8b583177dce4dab4ab3561d7
parent1a296bfd3e775e515233f746218824fc7dd5ff16
wifi: mt76: mt792x: fix NULL dereference in ACPI SAR init during probe

Some laptops carry a MediaTek power table in their firmware, and the
driver reads it to set a transmit limit for each frequency range.  It
only fills in the ranges themselves when it registers the device.

The startup step that does this existed already, but it never programmed
anything.  Two recent commits made it run a regulatory update instead,
which sets the limits on the way through, long before registration.

As a result, on a machine that has the table the driver reads through an
empty pointer and the interface never appears:

  BUG: kernel NULL pointer dereference, address: 0000000000000004
  RIP: 0010:mt792x_init_acpi_sar_power
  Call Trace:
   mt7921_set_tx_sar_pwr
   mt7921_mcu_regd_update
   mt7921_regd_update
   mt7921_run_firmware
   mt7921e_mcu_init
   mt7921_init_work

Skip it when the ranges are missing. They are applied again once the
device is up, which is where they came from before.

Reported-by: Klara Modin <klarasmodin@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/aoyxqHYvSuaBeubf@soda.int.kasm.eu/
Fixes: 9b80bd9cab40 ("wifi: mt76: mt7921: add regulatory wiphy self manager support")
Fixes: e9f3f1cc133f ("wifi: mt76: mt7925: add regulatory wiphy self manager support")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Tested-by: David Gow <david@davidgow.net>
Tested-by: Klara Modin <klarasmodin@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/net/wireless/mediatek/mt76/mt792x_acpi_sar.c