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 <[email protected]> Fixes: 634ec0b ("ALSA: firewire-motu: notify event for parameter change in register DSP model") Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 4f876bf commit c7a806d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)