From: Takashi Iwai Date: Tue, 3 Dec 2024 13:52:47 +0000 (+0100) Subject: ALSA: hda: Always check capability at opening a hwdep X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d7b6d5d949ca73d51123a9e95e141376e04609f0;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index 727f39acedfcb..9325e5c3cbe6c 100644 --- a/sound/pci/hda/hda_hwdep.c +++ b/sound/pci/hda/hda_hwdep.c @@ -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; }