lkml.org 
[lkml]   [2009]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [Patch] ipc: remove unreachable code in sem.c
On Tue, 1 Dec 2009 01:57:09 -0500
Amerigo Wang <amwang@redhat.com> wrote:

> This line is unreachable, remove it.
>
> Signed-off-by: WANG Cong <amwang@redhat.com>
>
> ---
> diff --git a/ipc/sem.c b/ipc/sem.c
> index 87c2b64..8439f2f 100644
> --- a/ipc/sem.c
> +++ b/ipc/sem.c
> @@ -652,7 +652,6 @@ static int semctl_nolock(struct ipc_namespace *ns, int semid,
> default:
> return -EINVAL;
> }
> - return err;
> out_unlock:
> sem_unlock(sma);
> return err;

If we're going to do that then there's no point in initialising `err':

--- a/ipc/sem.c~ipc-remove-unreachable-code-in-semc-fix
+++ a/ipc/sem.c
@@ -624,7 +624,7 @@ static unsigned long copy_semid_to_user(
static int semctl_nolock(struct ipc_namespace *ns, int semid,
int cmd, int version, union semun arg)
{
- int err = -EINVAL;
+ int err;
struct sem_array *sma;

switch(cmd) {
_

you should have noticed this!


\
 
 \ /
  Last update: 2009-12-02 23:49    [W:0.116 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site