[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1556106615-18722-1-git-send-email-kamlakantp@marvell.com>
Date: Wed, 24 Apr 2019 11:50:43 +0000
From: Kamlakant Patel <kamlakantp@...vell.com>
To: Corey Minyard <minyard@....org>
CC: Kamlakant Patel <kamlakantp@...vell.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jayachandran Chandrasekharan Nair <jnair@...vell.com>,
"openipmi-developer@...ts.sourceforge.net"
<openipmi-developer@...ts.sourceforge.net>
Subject: [PATCH] ipmi:ssif: compare block number correctly for multi-part
return messages
According to ipmi spec, block number is a number that is incremented,
starting with 0, for each new block of message data returned using the
Middle transaction.
Here, the 'blocknum' is data[0] which always starts from zero(0) and
'ssif_info->multi_pos' starts from 1.
So, we need to add +1 to blocknum while comparing with multi_pos.
This change fixes ("ipmi:ssif: Fix handling of multi-part return
messages").
Reported-by: Kiran Kolukuluru <kirank@....com>
Signed-off-by: Kamlakant Patel <kamlakantp@...vell.com>
---
drivers/char/ipmi/ipmi_ssif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 8b5aec5..2b03845 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -727,7 +727,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
/* End of read */
len = ssif_info->multi_len;
data = ssif_info->data;
- } else if (blocknum != ssif_info->multi_pos) {
+ } else if (blocknum + 1 != ssif_info->multi_pos) {
/*
* Out of sequence block, just abort. Block
* numbers start at zero for the second block,
--
1.8.3.1
Powered by blists - more mailing lists