Skip to content

Commit c7a806d

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-motu: fix unreleased lock warning in hwdep device
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: 634ec0b ("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>
1 parent 4f876bf commit c7a806d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sound/firewire/motu/motu-hwdep.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
8787
return -EFAULT;
8888

8989
count = consumed;
90+
} else {
91+
spin_unlock_irq(&motu->lock);
92+
93+
count = 0;
9094
}
9195

9296
return count;

0 commit comments

Comments
 (0)