Skip to content

Commit

Permalink
discover/platform-powerpc: return the actual mailbox size
Browse files Browse the repository at this point in the history
get_ipmi_boot_mailbox_block() should return the actual size
of the received IPMI mailbox data

Signed-off-by: Maxim Polyakov <m.polyakov@yadro.com>
  • Loading branch information
maxpoliak authored and jk-ozlabs committed Oct 8, 2019
1 parent 1088a8a commit 5f8321e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions discover/platform-powerpc.c
Expand Up @@ -473,12 +473,7 @@ static int get_ipmi_boot_mailbox_block(struct platform_powerpc *platform,
return -1;
}

if (resp_len == 4) {
pb_debug_fn("block %hu empty\n", block);
return 0;
}

blocksize = sizeof(resp) - 4;
blocksize = resp_len - 4;
pb_debug_fn("Mailbox block %hu returns only %zu bytes in block\n",
block, blocksize);

Expand Down Expand Up @@ -512,6 +507,12 @@ static int get_ipmi_boot_mailbox_block(struct platform_powerpc *platform,
return -1;
}

if (!blocksize) {
pb_debug_fn("block %hu empty\n", block);
return 0;
}


memcpy(buf, &resp[4], blocksize);

return blocksize;
Expand Down

0 comments on commit 5f8321e

Please sign in to comment.