All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: kvm-ia64@vger.kernel.org
Subject: [PATCH] KVM: dereference of NULL pointer in set_pal_result()
Date: Thu, 07 Jan 2010 22:11:57 +0000	[thread overview]
Message-ID: <4B465C2D.8030303@gmail.com> (raw)

Do not dereference a NULL pointer

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 arch/ia64/kvm/kvm_fw.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/kvm/kvm_fw.c b/arch/ia64/kvm/kvm_fw.c
index e4b8231..d28494f 100644
--- a/arch/ia64/kvm/kvm_fw.c
+++ b/arch/ia64/kvm/kvm_fw.c
@@ -75,9 +75,11 @@ 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)
+		return;
+	if (p->exit_reason = EXIT_REASON_PAL_CALL) {
 		p->u.pal_data.ret = result;
-		return ;
+		return;
 	}
 	INIT_PAL_STATUS_UNIMPLEMENTED(p->u.pal_data.ret);
 }

WARNING: multiple messages have this Message-ID (diff)
From: Roel Kluin <roel.kluin@gmail.com>
To: Xiantao Zhang <xiantao.zhang@intel.com>,
	kvm-ia64@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] KVM: dereference of NULL pointer in set_pal_result()
Date: Thu, 07 Jan 2010 23:11:57 +0100	[thread overview]
Message-ID: <4B465C2D.8030303@gmail.com> (raw)

Do not dereference a NULL pointer

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 arch/ia64/kvm/kvm_fw.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/kvm/kvm_fw.c b/arch/ia64/kvm/kvm_fw.c
index e4b8231..d28494f 100644
--- a/arch/ia64/kvm/kvm_fw.c
+++ b/arch/ia64/kvm/kvm_fw.c
@@ -75,9 +75,11 @@ 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)
+		return;
+	if (p->exit_reason == EXIT_REASON_PAL_CALL) {
 		p->u.pal_data.ret = result;
-		return ;
+		return;
 	}
 	INIT_PAL_STATUS_UNIMPLEMENTED(p->u.pal_data.ret);
 }

             reply	other threads:[~2010-01-07 22:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 22:11 Roel Kluin [this message]
2010-01-07 22:11 ` [PATCH] KVM: dereference of NULL pointer in set_pal_result() Roel Kluin
2010-01-07 23:28 ` Zhang, Xiantao
2010-01-07 23:28   ` Zhang, Xiantao
2010-01-08  7:12 ` Gabor Gombas
2010-01-08  7:12   ` Gabor Gombas
2010-01-08  9:14 ` Zhang, Xiantao
2010-01-08  9:14   ` Zhang, Xiantao
2010-01-08 12:25 ` roel kluin
2010-01-08 12:25   ` roel kluin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B465C2D.8030303@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=kvm-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.