Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: fireface: remove unnecessary condition in hwdep_read()

Smatch complains that "count" is not clamped when "ff->dev_lock_changed"
and it leads to an information leak. Fortunately, that's not actually
possible and the condition can be deleted.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/YA6n6I8EcNAO5ZFs@mwanda
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Dan Carpenter and committed by
Takashi Iwai
f4514249 00f3a411

+4 -6
+4 -6
sound/firewire/fireface/ff-hwdep.c
··· 35 35 } 36 36 37 37 memset(&event, 0, sizeof(event)); 38 - if (ff->dev_lock_changed) { 39 - event.lock_status.type = SNDRV_FIREWIRE_EVENT_LOCK_STATUS; 40 - event.lock_status.status = (ff->dev_lock_count > 0); 41 - ff->dev_lock_changed = false; 38 + event.lock_status.type = SNDRV_FIREWIRE_EVENT_LOCK_STATUS; 39 + event.lock_status.status = (ff->dev_lock_count > 0); 40 + ff->dev_lock_changed = false; 42 41 43 - count = min_t(long, count, sizeof(event.lock_status)); 44 - } 42 + count = min_t(long, count, sizeof(event.lock_status)); 45 43 46 44 spin_unlock_irq(&ff->lock); 47 45