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] [day] [month] [year] [list]
Message-ID: <4B177654.2090504@redhat.com>
Date:	Thu, 03 Dec 2009 16:27:00 +0800
From:	Cong Wang <amwang@...hat.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [Patch] ipc: remove unreachable code in sem.c

Andrew Morton wrote:
> On Tue, 1 Dec 2009 01:57:09 -0500
> Amerigo Wang <amwang@...hat.com> wrote:
> 
>> This line is unreachable, remove it.
>>
>> Signed-off-by: WANG Cong <amwang@...hat.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!

Oh, I didn't realize that. Thank you!

--
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