From 7a66d8725dbe40dfd45b3de0066d8363cc82b184 Mon Sep 17 00:00:00 2001 From: Ivan Mikhaylov Date: Thu, 23 Jan 2020 18:06:47 +0300 Subject: [PATCH] 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 Signed-off-by: Alexander Amelkin --- lib/ipmi_chassis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ipmi_chassis.c b/lib/ipmi_chassis.c index 4056f83..f75f7d8 100644 --- a/lib/ipmi_chassis.c +++ b/lib/ipmi_chassis.c @@ -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 * 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;