diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-03-11 09:12:58 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-03-11 09:12:58 +0100 |
commit | 14b9e4ab71b3f58828c107d7158e52da1e670d1c (patch) | |
tree | c47d143c8315a02985cce3e0d6d63b07b5f865a2 /sound/core/info_oss.c | |
parent | 21e59fe2f7221cdc77b2e5ef90a04c302b237053 (diff) | |
parent | 6fa9ba2d6278da69ef11c3c8e1ac6163437d1fca (diff) |
Merge branch 'for-next' into for-linus
Prep for 6.9 merge.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/info_oss.c')
-rw-r--r-- | sound/core/info_oss.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c index ebc714b2f46b..0dbbb8005570 100644 --- a/sound/core/info_oss.c +++ b/sound/core/info_oss.c @@ -29,20 +29,17 @@ int snd_oss_info_register(int dev, int num, char *string) return -ENXIO; if (snd_BUG_ON(num < 0 || num >= SNDRV_CARDS)) return -ENXIO; - mutex_lock(&strings); + guard(mutex)(&strings); if (string == NULL) { x = snd_sndstat_strings[num][dev]; kfree(x); x = NULL; } else { x = kstrdup(string, GFP_KERNEL); - if (x == NULL) { - mutex_unlock(&strings); + if (x == NULL) return -ENOMEM; - } } snd_sndstat_strings[num][dev] = x; - mutex_unlock(&strings); return 0; } EXPORT_SYMBOL(snd_oss_info_register); @@ -53,7 +50,7 @@ static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int d char *str; snd_iprintf(buf, "\n%s:", id); - mutex_lock(&strings); + guard(mutex)(&strings); for (idx = 0; idx < SNDRV_CARDS; idx++) { str = snd_sndstat_strings[idx][dev]; if (str) { @@ -64,7 +61,6 @@ static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int d snd_iprintf(buf, "%i: %s\n", idx, str); } } - mutex_unlock(&strings); if (ok < 0) snd_iprintf(buf, " NOT ENABLED IN CONFIG\n"); return ok; |