aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorColin Ian King2015-10-08 20:00:58 +0100
committerMichael Ellerman2015-10-09 08:03:03 +1100
commitc13e1c05b22b504bf0d72fc762a02be37df2d1b0 (patch)
tree796f88a14c65ab3de13d3044a1d02bd419c12100 /arch
parentf78f7ed72632a0794161f290b89e2cd752f55202 (diff)
powerpc/pseries/hvcserver: don't memset pi_buff if it is null
pi_buff is being memset before it is sanity checked. Move the memset after the null pi_buff sanity check to avoid an oops. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pseries/hvcserver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/hvcserver.c b/arch/powerpc/platforms/pseries/hvcserver.c
index eedb64594dc5..94a6e5612b0d 100644
--- a/arch/powerpc/platforms/pseries/hvcserver.c
+++ b/arch/powerpc/platforms/pseries/hvcserver.c
@@ -142,11 +142,11 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,
int more = 1;
int retval;
- memset(pi_buff, 0x00, PAGE_SIZE);
/* invalid parameters */
if (!head || !pi_buff)
return -EINVAL;
+ memset(pi_buff, 0x00, PAGE_SIZE);
last_p_partition_ID = last_p_unit_address = ~0UL;
INIT_LIST_HEAD(head);