[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180308061224.GA5299@felix-thinkpad.cavium.com>
Date: Wed, 7 Mar 2018 22:12:24 -0800
From: Felix Manlunas <felix.manlunas@...ium.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, raghu.vatsavayi@...ium.com,
derek.chickles@...ium.com, satananda.burla@...ium.com,
intiyaz.basha@...ium.com, felix.manlunas@...ium.com
Subject: [PATCH net-next] liquidio: Resolved mbox read issue while reading
more than one 64bit data
From: Intiyaz Basha <intiyaz.basha@...ium.com>
Corrected length check when data received in the mbox is more than one
64 bit data value
Signed-off-by: Intiyaz Basha <intiyaz.basha@...ium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@...ium.com>
---
drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c b/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
index 57af7df..28e74ee 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
@@ -87,7 +87,7 @@ int octeon_mbox_read(struct octeon_mbox *mbox)
}
if (mbox->state & OCTEON_MBOX_STATE_REQUEST_RECEIVING) {
- if (mbox->mbox_req.recv_len < msg.s.len) {
+ if (mbox->mbox_req.recv_len < mbox->mbox_req.msg.s.len) {
ret = 0;
} else {
mbox->state &= ~OCTEON_MBOX_STATE_REQUEST_RECEIVING;
@@ -96,7 +96,8 @@ int octeon_mbox_read(struct octeon_mbox *mbox)
}
} else {
if (mbox->state & OCTEON_MBOX_STATE_RESPONSE_RECEIVING) {
- if (mbox->mbox_resp.recv_len < msg.s.len) {
+ if (mbox->mbox_resp.recv_len <
+ mbox->mbox_resp.msg.s.len) {
ret = 0;
} else {
mbox->state &=
--
1.8.3.1
Powered by blists - more mailing lists