diff options
author | Tong Zhang <ztong0001@gmail.com> | 2020-08-24 18:45:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-09 19:04:30 +0200 |
commit | a69e790bce633b69759817cc53d22e0c8ab1c657 (patch) | |
tree | 9e18471cf95a4ad47afd8eb36b778d6fdeeb9a4f | |
parent | 669f22290ec9204145b38a6eedcb8461c279769b (diff) | |
download | linux-stable-a69e790bce633b69759817cc53d22e0c8ab1c657.tar.gz linux-stable-a69e790bce633b69759817cc53d22e0c8ab1c657.tar.bz2 linux-stable-a69e790bce633b69759817cc53d22e0c8ab1c657.zip |
ALSA: ca0106: fix error code handling
commit ee0761d1d8222bcc5c86bf10849dc86cf008557c upstream.
snd_ca0106_spi_write() returns 1 on error, snd_ca0106_pcm_power_dac()
is returning the error code directly, and the caller is expecting an
negative error code
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200824224541.1260307-1-ztong0001@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | sound/pci/ca0106/ca0106_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index cd27b5536654..675b812e96d6 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -551,7 +551,8 @@ static int snd_ca0106_pcm_power_dac(struct snd_ca0106 *chip, int channel_id, else /* Power down */ chip->spi_dac_reg[reg] |= bit; - return snd_ca0106_spi_write(chip, chip->spi_dac_reg[reg]); + if (snd_ca0106_spi_write(chip, chip->spi_dac_reg[reg]) != 0) + return -ENXIO; } return 0; } |