You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ALSA: hda: tas2781-spi: Fix bogus error handling in tas2781_hda_spi_probe()
The error handling in tas2781_hda_spi_probe() has quite a few
problems, as reported by Dan Carpenter. The code jumps to err label
and calls tas2781_hda_remove(), but this call would rather crash.
In some places, no error code is set properly, and the runtime PM
setup is doubly done.
This patch tries to address those bogus error handling. Basically we
can return immediately at each error before adding the component.
Also, the error code should be set properly for the unmatched SPI
device name. And finally, component_add() should be added before
enabling the runtime PM.
Fixes: bb5f86e ("ALSA: hda/tas2781: Add tas2781 hda SPI driver")
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/[email protected]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
0 commit comments