chassis: bootmbox: Refix 62a04390

Fix ipmitool not writing the last block of boot mailbox data if the
block is shorter than 3 bytes.

Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Ivan Mikhaylov 2020-01-23 18:06:47 +03:00 committed by Alexander Amelkin
parent 63dd71c39c
commit 7a66d8725d
No known key found for this signature in database
GPG Key ID: E893587B5B74178D

View File

@ -1408,7 +1408,8 @@ chassis_set_bootmailbox(struct ipmi_intf *intf, int16_t block, bool use_text,
* We need to write all data, so calculate the data * We need to write all data, so calculate the data
* size in blocks and set the starting block to zero. * size in blocks and set the starting block to zero.
*/ */
blocks = datasize; blocks = CHASSIS_BOOT_MBOX_IANA_SZ;
blocks += datasize;
blocks += CHASSIS_BOOT_MBOX_BLOCK_SZ - 1; blocks += CHASSIS_BOOT_MBOX_BLOCK_SZ - 1;
blocks /= CHASSIS_BOOT_MBOX_BLOCK_SZ; blocks /= CHASSIS_BOOT_MBOX_BLOCK_SZ;