From 119c933eb8a183373fd815b03c18cdf196514501 Mon Sep 17 00:00:00 2001 From: Moyster Date: Thu, 29 Nov 2018 13:51:22 +0100 Subject: sound: core: fix warning: this 'if' clause does not guard... [-Wmisleading-indentation] in function 'snd_timer_user_read' /home/oyster/Github/android_kernel_m2note/sound/core/timer.c: In function 'snd_timer_user_read': /home/oyster/Github/android_kernel_m2note/sound/core/timer.c:1986:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (copy_to_user(buffer, &tu->tqueue[qhead], ^~ /home/oyster/Github/android_kernel_m2note/sound/core/timer.c:1989:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' err = -EFAULT; ^~~ /home/oyster/Github/android_kernel_m2note/sound/core/timer.c:1991:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (copy_to_user(buffer, &tu->queue[qhead], ^~ /home/oyster/Github/android_kernel_m2note/sound/core/timer.c:1994:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' err = -EFAULT; ^~~ --- sound/core/timer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sound/core') diff --git a/sound/core/timer.c b/sound/core/timer.c index 51d1e3b03..9ef7e0726 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -1984,14 +1984,16 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, mutex_lock(&tu->ioctl_lock); if (tu->tread) { if (copy_to_user(buffer, &tu->tqueue[qhead], - sizeof(struct snd_timer_tread))) + sizeof(struct snd_timer_tread))) { mutex_unlock(&tu->ioctl_lock); err = -EFAULT; + } } else { if (copy_to_user(buffer, &tu->queue[qhead], - sizeof(struct snd_timer_read))) + sizeof(struct snd_timer_read))) { mutex_unlock(&tu->ioctl_lock); err = -EFAULT; + } } mutex_unlock(&tu->ioctl_lock); -- cgit v1.2.3