projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45b3605
)
ASoC: rt-sdw-common: Enhance switch case to prevent uninitialized variable
author
Jack Yu
<jack.yu@realtek.com>
Mon, 14 Oct 2024 09:55:20 +0000
(09:55 +0000)
committer
Mark Brown
<broonie@kernel.org>
Mon, 14 Oct 2024 11:45:20 +0000
(12:45 +0100)
If det_mode is not 0, 3 or 5 then function will return
jack_type with an uninitialzed value.
Enhance switch case to prevent uninitialized variable issue.
Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link:
https://patch.msgid.link/8631337239d744088d56caab2d8f39cb@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt-sdw-common.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/rt-sdw-common.c
b/sound/soc/codecs/rt-sdw-common.c
index
a422da6
..
9f51fec
100644
(file)
--- a/
sound/soc/codecs/rt-sdw-common.c
+++ b/
sound/soc/codecs/rt-sdw-common.c
@@
-150,15
+150,15
@@
int rt_sdca_headset_detect(struct regmap *map, unsigned int entity_id)
goto io_error;
switch (det_mode) {
- case 0x00:
- jack_type = 0;
- break;
case 0x03:
jack_type = SND_JACK_HEADPHONE;
break;
case 0x05:
jack_type = SND_JACK_HEADSET;
break;
+ default:
+ jack_type = 0;
+ break;
}
/* write selected_mode */