public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Nicholas Krause <xerofoify@gmail•com>
To: gleb@kernel•org
Cc: pbonzini@redhat•com, agraf@suse•com, kvm@vger•kernel.org,
	kvm-ppc@vger•kernel.org, linuxppc-dev@lists•ozlabs.org,
	linux-kernel@vger•kernel.org
Subject: [PATCH] kvm:powerpc:Fix incorrect return statement in the function mpic_set_default_irq_routing
Date: Fri,  7 Aug 2015 11:54:53 -0400	[thread overview]
Message-ID: <1438962893-3370-1-git-send-email-xerofoify@gmail.com> (raw)

This fixes the incorrect return statement in the function
mpic_set_default_irq_routing from always returning zero
to signal success to this function's caller to instead
return the return value of kvm_set_irq_routing as this
function can fail and we need to correctly signal the
caller of mpic_set_default_irq_routing when the call
to this particular function has failed.

Signed-off-by: Nicholas Krause <xerofoify@gmail•com>
---
 arch/powerpc/kvm/mpic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c
index 6249cdc..b14b85a 100644
--- a/arch/powerpc/kvm/mpic.c
+++ b/arch/powerpc/kvm/mpic.c
@@ -1641,16 +1641,17 @@ static void mpic_destroy(struct kvm_device *dev)
 static int mpic_set_default_irq_routing(struct openpic *opp)
 {
 	struct kvm_irq_routing_entry *routing;
+	int ret;
 
 	/* Create a nop default map, so that dereferencing it still works */
 	routing = kzalloc((sizeof(*routing)), GFP_KERNEL);
 	if (!routing)
 		return -ENOMEM;
 
-	kvm_set_irq_routing(opp->kvm, routing, 0, 0);
+	ret = kvm_set_irq_routing(opp->kvm, routing, 0, 0);
 
 	kfree(routing);
-	return 0;
+	return ret;
 }
 
 static int mpic_create(struct kvm_device *dev, u32 type)
-- 
2.1.4

             reply	other threads:[~2015-08-07 15:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 15:54 Nicholas Krause [this message]
2015-08-12 19:05 ` [PATCH] kvm:powerpc:Fix incorrect return statement in the function mpic_set_default_irq_routing Alexander Graf
2015-08-12 19:06   ` nick
2015-08-12 19:12     ` Alexander Graf

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=1438962893-3370-1-git-send-email-xerofoify@gmail.com \
    --to=xerofoify@gmail$(echo .)com \
    --cc=agraf@suse$(echo .)com \
    --cc=gleb@kernel$(echo .)org \
    --cc=kvm-ppc@vger$(echo .)kernel.org \
    --cc=kvm@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=pbonzini@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox