Skip to content

Commit

Permalink
powerpc/pseries/hvcserver: don't memset pi_buff if it is null
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Michael Ellerman committed Oct 8, 2015
1 parent f78f7ed commit c13e1c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/hvcserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c13e1c0

Please sign in to comment.