summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-01-30 23:15:40 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-09 11:28:08 +0100
commit3214b04de31ba505678a93ead796472704fed747 (patch)
tree8ae96e9aa145b25b1bff53d67da44fb7ef1252d9
parent37c0cdf7e4919e5f76381ac60817b67bcbdacb50 (diff)
downloadlinux-stable-3214b04de31ba505678a93ead796472704fed747.tar.gz
linux-stable-3214b04de31ba505678a93ead796472704fed747.tar.bz2
linux-stable-3214b04de31ba505678a93ead796472704fed747.zip
ALSA: firewire-motu: fix unreleased lock warning in hwdep device
[ Upstream commit c7a806d9ce6757ff56078674916e53bd859f242d ] Smatch static analysis tool detects that acquired lock is not released in hwdep device when condition branch is passed due to no event. It is unlikely to occur, while fulfilling is preferable for better coding. Reported-by: Dan Carpenter <error27@gmail.com> Fixes: 634ec0b2906e ("ALSA: firewire-motu: notify event for parameter change in register DSP model") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230130141540.102854-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/firewire/motu/motu-hwdep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/firewire/motu/motu-hwdep.c b/sound/firewire/motu/motu-hwdep.c
index a900fc0e7644..88d1f4b56e4b 100644
--- a/sound/firewire/motu/motu-hwdep.c
+++ b/sound/firewire/motu/motu-hwdep.c
@@ -87,6 +87,10 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
return -EFAULT;
count = consumed;
+ } else {
+ spin_unlock_irq(&motu->lock);
+
+ count = 0;
}
return count;