提交 c13e1c05 编写于 作者: C Colin Ian King 提交者: Michael Ellerman

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: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 f78f7ed7
...@@ -142,11 +142,11 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head, ...@@ -142,11 +142,11 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,
int more = 1; int more = 1;
int retval; int retval;
memset(pi_buff, 0x00, PAGE_SIZE);
/* invalid parameters */ /* invalid parameters */
if (!head || !pi_buff) if (!head || !pi_buff)
return -EINVAL; return -EINVAL;
memset(pi_buff, 0x00, PAGE_SIZE);
last_p_partition_ID = last_p_unit_address = ~0UL; last_p_partition_ID = last_p_unit_address = ~0UL;
INIT_LIST_HEAD(head); INIT_LIST_HEAD(head);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册