lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140916074821.GA21542@gmail.com>
Date:	Tue, 16 Sep 2014 09:48:22 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Davidlohr Bueso <dave@...olabs.net>
Cc:	peterz@...radead.org, linux-kernel@...r.kernel.org, dbueso@...e.de
Subject: Re: [PATCH 2/2] locking/rwsem-spinlock: Cleanup down_read()


* Davidlohr Bueso <dave@...olabs.net> wrote:

> ... when returning from a successful lock acquisition. The horror!
> 
> Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
> ---
>  kernel/locking/rwsem-spinlock.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/kernel/locking/rwsem-spinlock.c b/kernel/locking/rwsem-spinlock.c
> index 2c93571..07e456c 100644
> --- a/kernel/locking/rwsem-spinlock.c
> +++ b/kernel/locking/rwsem-spinlock.c
> @@ -130,7 +130,7 @@ void __sched __down_read(struct rw_semaphore *sem)
>  		/* granted */
>  		sem->count++;
>  		raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
> -		goto out;
> +		return;
>  	}
>  
>  	tsk = current;
> @@ -155,8 +155,6 @@ void __sched __down_read(struct rw_semaphore *sem)
>  	}
>  
>  	tsk->state = TASK_RUNNING;
> - out:
> -	;
>  }

It following an existing 'out' pattern found elsewhere in the 
file - I don't think there's much wrong about that per se - 
especially in locking code we try to not return from the middle 
of the flow.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ