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]
Date:	Sun, 17 Jan 2010 11:19:57 +0800
From:	"Zhang, Xiantao" <xiantao.zhang@...el.com>
To:	Bill Davidsen <davidsen@....com>, Roel Kluin <roel.kluin@...il.com>
CC:	"kvm-ia64@...r.kernel.org" <kvm-ia64@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, Avi Kivity <avi@...hat.com>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: RE: [PATCH] KVM: remove redundant NULL tests

Bill Davidsen wrote:
> Roel Kluin wrote:
>> kvm_get_exit_data() cannot return a NULL pointer.
>> 
>> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
>> ---
>>  arch/ia64/kvm/kvm_fw.c |   28 +++++++++++++---------------
>>  1 files changed, 13 insertions(+), 15 deletions(-)
>> 
>> diff --git a/arch/ia64/kvm/kvm_fw.c b/arch/ia64/kvm/kvm_fw.c
>> index e4b8231..cb548ee 100644
>> --- a/arch/ia64/kvm/kvm_fw.c
>> +++ b/arch/ia64/kvm/kvm_fw.c
>> @@ -75,7 +75,7 @@ static void set_pal_result(struct kvm_vcpu *vcpu, 
>> struct exit_ctl_data *p; 
>> 
>>  	p = kvm_get_exit_data(vcpu);
>> -	if (p && p->exit_reason == EXIT_REASON_PAL_CALL) {
>> +	if (p->exit_reason == EXIT_REASON_PAL_CALL) {
>>  		p->u.pal_data.ret = result;
>>  		return ;
>>  	}
> 	[___etc___]
> 
> Clearly the original author thought that there was a path where
> kvm_exit_data could return a NULL pointer, was that ever possible?

Originally, we planed to allocate the exit_data dynamically, but considering some constrains, the exit_data is allocated statically, so the check for NULL is useless now. 
Xiantao--
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