]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: hda/intel: Move firmware loading into the probe work
authorTakashi Iwai <tiwai@suse.de>
Wed, 15 Apr 2026 13:55:22 +0000 (15:55 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 16 Apr 2026 08:33:06 +0000 (10:33 +0200)
commiteb90ae3cca783ebec65704597027811431465de4
tree5fe91338c59d2f9983b4a9f04e77f259a2404ec8
parentd9448dca423543c6c0a9890d3ff53a5d51895318
ALSA: hda/intel: Move firmware loading into the probe work

The hda-intel driver uses request_firmware_nowait() for loading its
patch, and tries to continue the probe directly from the fw loader
callback.  This works in principle, but it has a few drawbacks:

- The driver may be released before the firmware callback completes
- Having two ways of async probe makes the code flow unnecessarily
  complex

The former issue is more severe, as it may potentially lead to a UAF,
and there is no explicit way to cancel the pending firmware worker
for now.

This patch changes the firmware loading to be performed rather in the
common probe work without *_nowait().  Then the pending work can be
easily canceled, and the code becomes more straightforward.

A nice bonus is that, by moving into the probe work, the firmware
doesn't need any longer to be cached, hence we can get rid of struct
azx.fw field, and release the firmware immediately after parsing it,
too.

Fixes: 5cb543dba986 ("ALSA: hda - Deferred probing with request_firmware_nowait()")
Link: https://patch.msgid.link/20260415135526.1813126-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/common/hda_controller.h
sound/hda/controllers/intel.c