From 9320d5ed1e6d2f4e3b038fce16d2d752a80092a0 Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Oct 2006 15:20:28 -0400
Subject: [PATCH] [UBUNTU:sound/pci/hda/] Fix error checks in HDA Realtek and
Analog Devices codecs for setting channel mode
UpstreamStatus: Added in upstream alsa-kernel hg changeset:
fb8c2e7fc5e6
[http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=fb8c2e7fc5e60ddc495f79f331e72e638c81d74a;style=raw]
This patch from Takashi Iwai fixes incorrect error checks in the HDA
Realtek and Analog Devices codecs for setting the channel mode.
This commit is applicable to both Dapper and Edgy linux-source.
Signed-off-by: Daniel T Chen <crimsun@xxxxxxxxxx>
---
sound/pci/hda/patch_analog.c | 2 +-
sound/pci/hda/patch_realtek.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 074998e..5a9426e 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1622,7 +1622,7 @@ static int ad198x_ch_mode_put(snd_kcontr
int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
spec->num_channel_mode,
&spec->multiout.max_channels);
- if (! err && spec->need_dac_fix)
+ if (err >= 0 && spec->need_dac_fix)
spec->multiout.num_dacs = spec->multiout.max_channels / 2;
return err;
}
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8291e92..ddd4ff0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -261,7 +261,7 @@ static int alc_ch_mode_put(snd_kcontrol_
int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
spec->num_channel_mode,
&spec->multiout.max_channels);
- if (! err && spec->need_dac_fix)
+ if (err >= 0 && spec->need_dac_fix)
spec->multiout.num_dacs = spec->multiout.max_channels / 2;
return err;
}
--
1.4.1
--
Daniel T. Chen crimsun@xxxxxxxxxx
GPG key: 0xC88ABDA3
pgpfW6I1tzBiK.pgp
Description: PGP signature
|