Commit fcbedd0f authored by Intiyaz Basha's avatar Intiyaz Basha Committed by David S. Miller

liquidio: Resolved mbox read issue while reading more than one 64bit data

Corrected length check when data received in the mbox is more than one
64 bit data value
Signed-off-by: default avatarIntiyaz Basha <intiyaz.basha@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd372a7a
...@@ -87,7 +87,7 @@ int octeon_mbox_read(struct octeon_mbox *mbox) ...@@ -87,7 +87,7 @@ int octeon_mbox_read(struct octeon_mbox *mbox)
} }
if (mbox->state & OCTEON_MBOX_STATE_REQUEST_RECEIVING) { 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; ret = 0;
} else { } else {
mbox->state &= ~OCTEON_MBOX_STATE_REQUEST_RECEIVING; mbox->state &= ~OCTEON_MBOX_STATE_REQUEST_RECEIVING;
...@@ -96,7 +96,8 @@ int octeon_mbox_read(struct octeon_mbox *mbox) ...@@ -96,7 +96,8 @@ int octeon_mbox_read(struct octeon_mbox *mbox)
} }
} else { } else {
if (mbox->state & OCTEON_MBOX_STATE_RESPONSE_RECEIVING) { 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; ret = 0;
} else { } else {
mbox->state &= mbox->state &=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment