ALSA: hda: Always check capability at opening a hwdep

We have a capability check at hda_hwdep_open(), but it's applied only
conditionally and the check is skipped when CONFIG_SND_DEBUG_VERBOSE
is set.  This is rather inconsistent behavior, and we should apply the
check always no matter which config is chosen.

Link: https://patch.msgid.link/20241203135248.19840-1-tiwai@suse.de
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2024-12-03 14:52:47 +01:00
parent 24a53864da
commit d7b6d5d949

View File

@ -84,10 +84,8 @@ static int hda_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
static int hda_hwdep_open(struct snd_hwdep *hw, struct file *file)
{
#ifndef CONFIG_SND_DEBUG_VERBOSE
if (!capable(CAP_SYS_RAWIO))
return -EACCES;
#endif
return 0;
}